List:General Discussion« Previous MessageNext Message »
From:Ow Mun Heng Date:August 14 2006 5:09pm
Subject:Re: Joining result sets into 1 row
View as plain text  
On Mon, 2006-08-14 at 05:43 -0700, Steffan A. Cline wrote:
> Here is a better example
> 
> mysql> select listName from listItem limit 3;
> +-------------+
> | listName    |
> +-------------+
> | PWC         |
> | Small Boats |
> | Fiberglass  |
> +-------------+
> 3 rows in set (0.02 sec)
> 
> mysql> 
> 
> 
> Rather than return 3 rows I would like the data retruned as
> 
> mysql> select listName from listItem limit 3;
> +------------------------------+
> | listName                     |
> +------------------------------+
> | PWC, Small Boats, Fiberglass |
> +------------------------------+
> 1 row in set (0.02 sec)

Seems like what you want is to concat everything into 1 line separated
by Commas?
Hmm.. Not very sure how to get that done.

Is there anything which is unique about each item in the list?

Please Send to the Maillist as you will get more response from more
knowledgeable people there.


> > 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