Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 532AF4766E4 for ; Mon, 2 Dec 2002 14:11:41 -0500 (EST) Received: from epona.servers.oss-solutions.net (unknown [64.207.2.130]) by postgresql.org (Postfix) with SMTP id AC16447655D for ; Mon, 2 Dec 2002 13:54:31 -0500 (EST) Received: (qmail 6422 invoked from network); 2 Dec 2002 18:50:36 -0000 Received: from arsenic.secureworks.net (HELO gabrielle.secureworks.net) (cshobe@63.239.86.253) by epona.servers.oss-solutions.net with SMTP; 2 Dec 2002 18:50:36 -0000 Content-Type: text/plain; charset="us-ascii" From: Casey Allen Shobe Organization: Open Source Software Solutions To: pgsql-sql@postgresql.org Subject: Combining queries while preserving order in SQL - Help! Date: Mon, 2 Dec 2002 13:46:38 -0500 User-Agent: KMail/1.4.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200212021346.38338.cshobe@osss.net> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/13 X-Sequence-Number: 10601 Hi there, I need to do the following in one SQL query: select field1, field2, field3, field4, field5 from table where field6 < 5 order by field1 And a totals line which shows the sum for each column. The important part is that I need to preserve the order by of the first que= ry. Is there any way to do this in one query? Thank you, --=20 Casey Allen Shobe, Open Source Software Solutions cshobe@osss.net / http://www.osss.net / 770-653-4526