On 10/23/2011 10:01 AM, Mark Rotteveel wrote: > > On 23-10-2011 16:05, ibmcom2011 wrote: > > > > now i have a table such as: > > > > f1 f2 > > 1 aa > > 2 tf > > 1 bb > > 3 cc > > 2 ht > > > > i want the result seems as: > > > > f1 f2 > > 1 aa, bb > > 2 tf, ht > > 3 cc > > > > any help is appreciated, thanks. > > The following query should work: > SELECT f1, LIST(f2) FROM table GROUP BY f1 > > Be aware that there is no defined order for the result of LIST. > -- > Mark Rotteveel > > If you use distinct, it will order the list. But you can't get 1 aa, aa, bb. So no duplicates.
select f1, LIST(DISTINCT f2) from table group by f1 -- Thanks, Gordon [Non-text portions of this message have been removed]
