Subject | RE: [firebird-support] how to combine a field value while their id is same? |
---|---|
Author | Svein Erling Tysvær |
Post date | 2011-10-24T12:04:07Z |
>As far as I know that the result of LIST(DISTINCT ...) is ordered is onlyIs there any simple way to order such a list, or any plans to implement it? Thinking a bit about the LIST answer, I tried
>an implementation detail, so it shouldn't be something you depend on.
WITH TMP as
(select distinct f1, f2
From MyTable
Group by 1
Order by 2 desc)
Select f1, LIST(f2) from TMP group by 1
And to my surprise F2 was still ordered in ascending order in the output. Of course it can be done "manually" through EXECUTE BLOCK, it would just be nice if it was possible to do something like
Select f1, LIST(f2 descending) from TMP group by 1
Though I must admit I haven't needed such functionality yet and I don't know whether it would be worth the effort to implement something like this.
Set