Re: Get COUNT results from two different columns - Mailing list pgsql-general

From Ray O'Donnell
Subject Re: Get COUNT results from two different columns
Date
Msg-id 38fe6b0d-8958-68a2-dd65-81451a8c957a@rodonnell.ie
Whole thread Raw
In response to RE: Get COUNT results from two different columns  ("Clive Swan" <cliveswan@gmail.com>)
List pgsql-general
On 23/09/2021 14:37, Clive Swan wrote:
> Greetings,
> 
> I have two separate queries that work individually, returning a count 
> from each column.
> 
> I want to subtract New(COUNT) from Old(Count)
> 
> I get an error when trying to run UNION?

At a quick guess, you'll need to move the subtraction outside the two 
subqueries - stuff inside either query can't see anything in the other one.

Ray.


-- 
Raymond O'Donnell // Galway // Ireland
ray@rodonnell.ie



pgsql-general by date:

Previous
From: "Clive Swan"
Date:
Subject: RE: Get COUNT results from two different columns
Next
From: SQL Padawan
Date:
Subject: RE: Get COUNT results from two different columns