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