RE: [SQL] sum of two queries

Поиск
Список
Период
Сортировка
Искать
От
Michael J Davis
Тема
RE: [SQL] sum of two queries
Дата
Msg-id
93C04F1F5173D211A27900105AA8FCFC14540E@lambic.prevuenet.com
Список
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 по дате отправления
От: Daniel Facciolo Pires
Дата:
Сообщение:
От: Kyle Bateman
Дата:
Сообщение: Re: [SQL] sum of two queries
FAQ