Re: how to solve this problem

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: marchesini(at)unipg(dot)it, pgsql-sql(at)postgresql(dot)org
Subject: Re: how to solve this problem
Date: 2006-04-13 13:51:11
Message-ID: 20060413135111.78790.qmail@web31811.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Just a thought,

Could you achieve that same result using the binary representation of an integer?

Regards,

Richard

--- ivan marchesini <marchesini(at)unipg(dot)it> wrote:

> Dear users,
> I have this problem
>
> I have a table where there are 20 columns named
> vinc1, vinc2, vinc3, vinc4, etc....
>
> the values contained into each column are simply 1 or 0 (each column is
> dichotomic)
> 1 means presence
> 0 means absence
>
> I would obtain a column (new_column) containg the name of the columns,
> comma separated, where the value is = 1
>
> for example:
>
> vinc1 vinc2 vinc3 vinc4 new_column
> 1 0 1 0 vinc1,vinc3
> 0 0 0 1 vinc4
> 0 1 1 1 vinc2,vinc3,vinc4
>
> can someone help me to find the best way to obtain this result???
> thank you very much
>
> Ivan
>
>
>
>
>
>
>
> --
> Ivan Marchesini
> Department of Civil and Environmental Engineering
> University of Perugia
> Via G. Duranti 93/a
> 06125
> Perugia (Italy)
> e-mail: marchesini(at)unipg(dot)it
> ivan(dot)marchesini(at)gmail(dot)com
> tel: +39(0)755853760
> fax: +39(0)755853756
> jabber: geoivan73(at)jabber(dot)org
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message ivan marchesini 2006-04-13 13:56:36 Re: how to solve this problem
Previous Message ivan marchesini 2006-04-13 13:18:10 how to solve this problem