Re: FW: Query
Posted in 2005
I previosuly wrote: Try what Doug Lawry wrote. If that don't help, then What exactly are you trying to do? An example could clarify. J. PS: For example let say you have a table like this: Year-Month City Sale ---------- -------- ---- 2005-01 Cali 100 2005-01 Buga 29 2005-01 Palmira 20 2005-02 Cali 120 2005-02 Buga 12 2005-02 Palmira 45 2005-03 Cali 80 2005-03 Buga 9 2005-03 Palmira 75 Do you need a reorganization like this? City 2005-01 2005-02 2005-03 -------- ------- ------- ------- Cali 100 120 80 Palmira 20 45 75 Buga 29 12 9 Maybe totals? 2005-01 2005-02 2005-03 ------- ------- ------- 149 177 164 -----Original Message----- From: "shahid.mehmood" <shahid.mehmood@aku.edu> To: "Jean Sagi" <jeansagi@myrealbox.com> Date: Fri, 9 Sep 2005 17:28:04 +0500 Subject: RE: FW: Query I am novice to this ... Can you send me the SQL for limited number of columns, say 5? Thanks Sm/.. -----Original Message----- From: Jean Sagi [mailto:jeansagi@myrealbox.com] Sent: Friday, September 09, 2005 10:55 AM To: shahid.mehmood Cc: informix-list@iiug.org Subject: Re: FW: Query It could be done, but you must know the exact number of columns, if so then You can use decode to achieve what you want. If the number of columns is not know then I don't know, althoug in this case I think that could not be done using normal SQL. J. shahid.mehmood escribis: >> I want the return rows into columns, like >> >> >> >> The return rows in a select >> >> 1 >> >> 2 >> >> 3 >> >> 4 >> >> 5 >> >> >> >> Appear as >> >> 1 2 3 4 5 >> >> >> >> Is it possible? >> >> >> >> Thanx, >> >> S m >> sending to informix-list sending to informix-list Jean Sagi jeansagi@myrealbox.com jeansagi@gmail.com sending to informix-list shahid.mehmood escribis: > Sending again ... I didn't get the reply ... IF you have already done so ... Sorry about that ... But ... > > I am novice to this ... Can you send me the SQL for limited number of columns, say 5? > > Thanks > Sm/.. > > -----Original Message----- > From: Jean Sagi [mailto:jeansagi@myrealbox.com] > Sent: Friday, September 09, 2005 10:55 AM > To: shahid.mehmood > Cc: informix-list@iiug.org > Subject: Re: FW: Query > > It could be done, but you must know the exact number of columns, if so then You can use decode to achieve what you want. > > If the number of columns is not know then I don't know, althoug in this case I think that could not be done using normal SQL. > > > J. > > > shahid.mehmood escribis: > >>I want the return rows into columns, like >> >> >> >> The return rows in a select >> >> 1 >> >> 2 >> >> 3 >> >> 4 >> >> 5 >> >> >> >> Appear as >> >> 1 2 3 4 5 >> >> >> >> Is it possible? >> >> >> >> Thanx, >> >> S m >>sending to informix-list > > sending to informix-list sending to informix-list