grouping a ordered list - Mailing list pgsql-sql

From phansen
Subject grouping a ordered list
Date
Msg-id 3615C951.EAAA75DE@idir.net
Whole thread Raw
List pgsql-sql
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


pgsql-sql by date:

Previous
From: darcy@druid.net (D'Arcy J.M. Cain)
Date:
Subject: Re: [SQL] Getting datatype before SELECT
Next
From: Herouth Maoz
Date:
Subject: RE: [SQL] Getting datatype before SELECT