Re: Conditional return of aggregated data

Поиск
Список
Период
Сортировка
От Ravi Krishna
Тема Re: Conditional return of aggregated data
Дата
Msg-id trinity-d51ed061-8e4e-47ba-b2e7-3f848e78588a-1575287818540@3c-app-mailcom-lxa04
обсуждение исходный текст
Ответ на Re: Conditional return of aggregated data  ("Ravi Krishna" <srkrishna@myself.com>)
Ответы Re: Conditional return of aggregated data  (Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>)
Список pgsql-general
>
> > My initial idea was something along the lines of :
> >  select (select sum(statcount) from stats_residence) as aggstat,statcount,short_name_en from stats_residence where
aggstat>some_number;
>
> Am I missing something basic.  The above can be done using
> GROUP BY and HAVING clause.
or this
with t as
(select (select sum(statcount) from stats_residence) as aggstat,
         statcount,short_name_en from stats_residence
)
select * from t where aggstat > some_number

Apology if I did not understand the question correctly.



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

Предыдущее
От: "Ravi Krishna"
Дата:
Сообщение: Re: Conditional return of aggregated data
Следующее
От: Laura Smith
Дата:
Сообщение: Re: Conditional return of aggregated data