Re: Sorting aggregate column contents
От | Everton Luís Berz |
---|---|
Тема | Re: Sorting aggregate column contents |
Дата | |
Msg-id | 4457F83C.7020505@gmail.com обсуждение исходный текст |
Ответ на | Re: Sorting aggregate column contents (Volkan YAZICI <yazicivo@ttnet.net.tr>) |
Ответы |
Re: Sorting aggregate column contents
|
Список | pgsql-sql |
It works fine. But I wouldn't like using subselect's, then if somebody elseknows about an operator or something like thatto put on the aggregator, please tell me. Volkan YAZICI escreveu: > On May 02 06:00, Everton Luís Berz wrote: > >> Is it possible to sort the content of an aggregate text column? >> >> Query: >> select s.name, ag_concat(c.name) from state s >> inner join city c on (c.idstate = s.idstate) >> group by s.name >> order by s.name; >> > > IMHO, you can receive results ordered by using a subselect: > > SELECT T.s_name, ag_concat(T.c_name) > FROM (SELECT s.name, c.name > FROM state AS s > INNER JOIN city AS c ON (c.idstate = s.idstate) > ORDER BY s.name, c.name) AS T (s_name, c_name) > GROUP BY T.s_name; > > > Regards. > >
В списке pgsql-sql по дате отправления: