List:General Discussion« Previous MessageNext Message »
From:Ow Mun Heng Date:August 13 2006 11:25pm
Subject:Re: Joining result sets into 1 row
View as plain text  
On Sun, 2006-08-13 at 15:53 -0700, Steffan A. Cline wrote:
> I am in a situation where I have say 1 column called "attribute" I need and
> the result set is 3 rows. i.e.
> ROW 1 - Mechanic
> ROW 2 - Carpenter
> ROW 3 - Plumber
> I want to have the rows returned as one row
> Such as 
> ROW 1 Mechanic, Carpenter, Plumber
> 
> Something like a literal join would be beautiful such as :
> ROW 1 Mechanic, Carpenter and Plumber

Not sure how your row are. is it really marked as Row1/Row2/Row3?
If yes, you can use a case expression.

select
case when row=row1 then row else null end as mechanic ,
case when row=row2 then row  else null end as carpenter,
end



Thread
Joining result sets into 1 rowSteffan A. Cline14 Aug
  • Re: Joining result sets into 1 rowOw Mun Heng14 Aug
  • Re: Joining result sets into 1 rowBrent Baisley14 Aug
  • Re: Joining result sets into 1 rowBrad Jahnke14 Aug
Re: Joining result sets into 1 rowOw Mun Heng14 Aug