Subject Re: Ordering in the LIST function
Author gusta1308
Try follow statement

select co.name_country, list(ci.name_city)
from country co
inner join (
select id_country, name_city from cities order by populate) ci
) on ci.id_country = co.id_country
group by country.name_country

Regards
Gustavo

--- In firebird-support@yahoogroups.com, "martins.goncalo"
<gmartins77@...> wrote:
>
> --- In firebird-support@yahoogroups.com, Dmitry Yemanov <dimitr@>
> wrote:
> >
> > martins.goncalo wrote:
> > >
> > > 2: This doesn't work (doesn't order the citys by population)
> > >
> > > select
> > > country.name_country,
> > > list(citys.name_city)
> > > from country,SP_CITYS citys
> > > where citys.id_country = country.id_country
> > > group by country.name_country
> >
> > Try this:
> >
> > select country.name_country, list(citys.name_city)
> > from country
> > left join SP_CITYS citys on citys.id_country = country.id_country
> > where citys.id_country is not null
> > group by country.name_country
> >
> >
> > Dmitry
> >
>
> Hello Dmitry:
>
> Tryed that but it's the same. The citys are returned by alphabetical
> order (strange...). This only happens if I use the group by. If I do
> the list directly to the procedure it works fine.
>