Subject Re: [firebird-support] Ordering in the LIST function
Author Dmitry Yemanov
martins.goncalo wrote:
>
> I like the new aggregate function LIST() but I'm having some trouble
> to do what I want to do with it.
>
> Imagine this situation:
>
> select
> country.name,
> list(city.name)
> from country,city
> where city.id_country = country.id_country
> group by country.name
>
> This is just an example but imagine I want the cities to be ordered in
> the list function by the population of each city (field existing in
> the city table).
> Is there any way to achieve this type of ordering in the list function?

Worth trying something like this:

select country.name, list(city.name)
from country, ( select name from city order by population ) city
where city.id_country = country.id_country
group by country.name


Dmitry