Re: Having the sum of two queries - Mailing list pgsql-sql

From Roberto Spier
Subject Re: Having the sum of two queries
Date
Msg-id 469B5D14.4090700@conab.gov.br
Whole thread Raw
In response to Having the sum of two queries  (Dani Castaños <danitao.mailists@gmail.com>)
List 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 by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: Having the sum of two queries
Next
From: Dmitry Turin
Date:
Subject: Re: [OBORONA-SPAM] calling webservice through postgresql function