Re: Get COUNT results from two different columns

Поиск
Список
Период
Сортировка
От Ray O'Donnell
Тема Re: Get COUNT results from two different columns
Дата
Msg-id 38fe6b0d-8958-68a2-dd65-81451a8c957a@rodonnell.ie
обсуждение исходный текст
Ответ на RE: Get COUNT results from two different columns  ("Clive Swan" <cliveswan@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "Clive Swan"
Дата:
Сообщение: RE: Get COUNT results from two different columns
Следующее
От: SQL Padawan
Дата:
Сообщение: RE: Get COUNT results from two different columns