Subject | Re: [firebird-support] Ordering in the LIST function |
---|---|
Author | Dmitry Yemanov |
Post date | 2008-05-30T12:47:03Z |
martins.goncalo wrote:
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
>Worth trying something like this:
> 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?
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