Subject Re: Ordering in the LIST function
Author martins.goncalo
Thanks Dmitry.
Yes, that works. But if I put the
( select name from city order by population ) city

in a procedure (ex: sp_get_citys_by_population)
the list doesn't work. The order is incorrect. Is this a bug of
firebird or list just doesn't work with procedures?

Thanks

Goncalo


--- In firebird-support@yahoogroups.com, Dmitry Yemanov <dimitr@...>
wrote:
>
> 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
>