Received: from mail.kc.idir.net (root@mail.kc.idir.net [209.172.192.4]) by hub.org (8.8.8/8.8.8) with ESMTP id MAA16988 for ; Sat, 3 Oct 1998 12:59:39 -0400 (EDT) (envelope-from phansen@idir.net) Received: from idir.net (port03.max2.kc.idir.net [209.172.222.27]) by mail.kc.idir.net (8.8.5/8.8.5) with ESMTP id KAA21825 for ; Sat, 3 Oct 1998 10:59:41 -0500 Sender: root@mail.kc.idir.net Message-ID: <3615C951.EAAA75DE@idir.net> Date: Sat, 03 Oct 1998 11:50:57 +0500 From: phansen X-Mailer: Mozilla 4.03 [en] (X11; I; Linux 2.1.43 i586) MIME-Version: 1.0 To: pgsql-sql@postgreSQL.org Subject: grouping a ordered list Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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