Re: Having the sum of two queries

Поиск
Список
Период
Сортировка
От Roberto Spier
Тема Re: Having the sum of two queries
Дата
Msg-id 469B5D14.4090700@conab.gov.br
обсуждение исходный текст
Ответ на Having the sum of two queries  (Dani Castaños <danitao.mailists@gmail.com>)
Список pgsql-sql
Dani Castaños escreveu:

...
>
> And have the result of both added.
>
> I've tried something like
>
> SELECT tot.status, COUNT(total)
Should be

SELECT tot.status, SUM(total)
> FROM( QUERY A UNION QUERY B ) AS tot
> GROUP BY tot.status
>
> But it doesn't works. It doesn't add the total columns with the same 
> status...




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

Предыдущее
От: Achilleas Mantzios
Дата:
Сообщение: Re: Having the sum of two queries
Следующее
От: Dmitry Turin
Дата:
Сообщение: Re: [OBORONA-SPAM] calling webservice through postgresql function