Received: from corppo1.uvsg.com (corppo1.uvsg.com [192.40.65.90]) by hub.org (8.9.3/8.9.1) with ESMTP id NAA93548 for ; Thu, 22 Apr 1999 13:53:07 -0400 (EDT) (envelope-from michael.j.davis@tvguide.com) Received: from prevuepo1.prevuenet.com (prevuepo1.uvsg.com [192.40.65.44]) by corppo1.uvsg.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id JCBQ6YMH; Thu, 22 Apr 1999 12:52:33 -0500 Received: by prevuepo1.uvsg.com with Internet Mail Service (5.5.2232.9) id ; Thu, 22 Apr 1999 12:55:33 -0500 Message-ID: <93C04F1F5173D211A27900105AA8FCFC14540E@lambic.prevuenet.com> From: Michael J Davis To: "'Kyle Bateman'" , pgsql-sql@postgreSQL.org Subject: RE: [SQL] sum of two queries Date: Thu, 22 Apr 1999 12:48:58 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2232.9) Content-Type: text/plain; charset="iso-8859-1" I use functions. For example: Create function1 as 'select sum(price) from items'; Create function2 as 'select sum(price) from widgets'; select function1 + function2; -----Original Message----- From: Kyle Bateman [SMTP:kyle@actarg.com] Sent: Thursday, April 22, 1999 11:26 AM To: pgsql-sql@postgreSQL.org Subject: [SQL] sum of two queries Is there a way to return the sum of two separate queries as in: select (select sum(price) from items) + (select sum(price) from widgets)) select 3 + 4 works OK but the parser doesn't like sticking a subquery in place of the numbers. Is there another way to do this? kyle@actarg.com