2011/2/8 Emi Lu :
> On 02/08/2011 02:51 PM, Rolando Edwards wrote:
>>
>> SELECT distinct c1,array_to_string(array(SELECT c2 FROM T1 B where
>> A.c1=B.c1),', ') from T1 A order by c1;
>>
>> Give it a Try !!!
>
>
> Thanks a lot! Very helpful!
>
> array_to_string() + array() is exactly what I am looki
On 02/08/2011 02:51 PM, Rolando Edwards wrote:
SELECT distinct c1,array_to_string(array(SELECT c2 FROM T1 B where
A.c1=B.c1),', ') from T1 A order by c1;
Give it a Try !!!
Thanks a lot! Very helpful!
array_to_string() + array() is exactly what I am looking for!
I just wonder that array_to_
I'm not saying this is good or best but:
select distinct a.c1, array_to_string(array(select c2 from t1 as b where
b.c1 = a.c1),',')
from t1 as a;
c1 | array_to_string
+-
1 | val1,val2,val3
2 | val1
3 | val5,val6
(3 rows)
On Tue, Feb 8, 2011 at 2:35 PM, Emi Lu wro
SELECT distinct c1,array_to_string(array(SELECT c2 FROM T1 B where
A.c1=B.c1),', ') from T1 A order by c1;
Give it a Try !!!
Rolando A. Edwards
MySQL DBA (SCMDBA)
155 Avenue of the Americas, Fifth Floor
New York, NY 10013
212-625-5307 (Work)
201-660-3221 (Cell)
AIM & Skype : RolandoLogicWorx
re
Hello
you can use a string%agg function if you have a 9.0. On older version
there is a array_agg function
select c1, array_to_string(array_agg(c2),',') from T1 group by c1
regards
Pavel Stehule
2011/2/8 Emi Lu :
> Good afternoon,
>
> Is there a method to retrieve the following results:
>
> T1(