Subject Re: [firebird-support] how to combine a field value while their id is same?
Author Mark Rotteveel
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