RE: [SQL] sum of two queries - Mailing list pgsql-sql

From Michael J Davis
Subject RE: [SQL] sum of two queries
Date
Msg-id 93C04F1F5173D211A27900105AA8FCFC14540E@lambic.prevuenet.com
Whole thread Raw
List pgsql-sql
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 AMTo:
pgsql-sql@postgreSQL.orgSubject:   [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) fromwidgets))
select 3 + 4 works OK but the parser doesn't like sticking a
subquery inplaceof the numbers.
Is there another way to do this?
kyle@actarg.com



pgsql-sql by date:

Previous
From: Daniel Facciolo Pires
Date:
Subject: ...
Next
From: Kyle Bateman
Date:
Subject: Re: [SQL] sum of two queries