sum of two queries

Поиск
Список
Период
Сортировка
От Kyle Bateman
Тема sum of two queries
Дата
Msg-id 371F5BBF.874251FD@actarg.com
обсуждение исходный текст
Список pgsql-sql
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




В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] Finding the "most recent" rows
Следующее
От: Daniel Facciolo Pires
Дата:
Сообщение: ...