grouping a ordered list

From: phansen <phansen(at)idir(dot)net>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: grouping a ordered list
Date: 1998-10-03 06:50:57
Message-ID: 3615C951.EAAA75DE@idir.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-sql by date

  From Date Subject
Next Message Herouth Maoz 1998-10-06 08:54:06 RE: [SQL] Getting datatype before SELECT
Previous Message D'Arcy J.M. Cain 1998-10-02 02:14:24 Re: [SQL] Getting datatype before SELECT