Subject | Re: how to combine a field value while their id is same? |
---|---|
Author | ibmcom2011 |
Post date | 2011-10-24T11:29:22Z |
--- In firebird-support@yahoogroups.com, Mark Rotteveel <mark@...> wrote:
thanks all very much.
>i have tried the sql, it can work very nicely.
> On Sun, 23 Oct 2011 21:23:20 -0500, Gordon Niessen <gordon@...>
> wrote:
> >> 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.
> >>
> > 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
>
> As far as I know that the result of LIST(DISTINCT ...) is ordered is only
> an implementation detail, so it shouldn't be something you depend on.
>
thanks all very much.