Re: [SQL] Select row cells as new columns

2012-06-04 Thread lewbloch
danycxxx wrote: > Yes, I've looked at it, but id doesn't create the desired output. After more > research I've found that I my design is similar to Entity, Attribute and > Value(EAV) design and I think I have to redesign. Any suggestion regarding > EAV? Is there any other approach? EAV is controve

Re: [SQL] Select row cells as new columns

2012-05-25 Thread danycxxx
Yes, I've looked at it, but id doesn't create the desired output. After more research I've found that I my design is similar to Entity, Attribute and Value(EAV) design and I think I have to redesign. Any suggestion regarding EAV? Is there any other approach? -- View this message in context: http:

Re: [SQL] Select row cells as new columns

2012-05-25 Thread Jan Lentfer
On Fri, 25 May 2012 02:03:41 -0700 (PDT), danycxxx wrote: [...] The question: How can I achive this output? nume, prenume, cnp, nume anterior, stare civila, ... (as columns - built from unique rows from infos) a , a, ... b , b, ... (as rows) Did you look at crosstab functio

[SQL] Select row cells as new columns

2012-05-25 Thread danycxxx
Hello. I hope you can help me with this or at least guide me into the right direction: I have 2 tables: CREATE TABLE infos ( id integer NOT NULL DEFAULT nextval('info_id_seq'::regclass), name text NOT NULL, id_member integer NOT NULL, title text, min_length integer NOT NULL DEFAULT 0,