Обсуждение: grouping a ordered list

Поиск
Список
Период
Сортировка

grouping a ordered list

От
phansen
Дата:
I am running postgresql6.3.2 on a SPARC20 with Solaris 2.6. and
have a table named tsv with

ttime abstime,
dtime abstime,
prmid int4,
val float,
com char,
qual char,
valid char

I would like to order by dtime ASC, prmid ASC, and ttime DESC then
group by dtime,prmid,ttime.

When I submit

select * from tsv group by dtime,prmid,ttime order ASC, prmid ASC, ttime
DESC;

grouping occurs before ordering.  How can I change this?  Can the
ordering be performed
on a sub select then group it?


Thanks in advance,

Paul Hansen