Re: Conditional return of aggregated data

Поиск
Список
Период
Сортировка
От Laura Smith
Тема Re: Conditional return of aggregated data
Дата
Msg-id 5SxiVL9RhGEtWNbFGaSgBdXfLZ42gr7xiAdGh2MGf0tXH7KcDKVwqLVKymHrod8BjCL59U8CC-Js_z99jQCZrTIPUCNN_jRyn_TJKBFxNdo=@protonmail.ch
обсуждение исходный текст
Ответ на Re: Conditional return of aggregated data  ("Ravi Krishna" <srkrishna@myself.com>)
Список pgsql-general
>
> 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.


Hi Ravi,

Thanks for helping show me the way.  You're quite right, a CTE did the trick

Laura



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

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