Re: Conditional return of aggregated data - Mailing list pgsql-general

From Laura Smith
Subject Re: Conditional return of aggregated data
Date
Msg-id 5SxiVL9RhGEtWNbFGaSgBdXfLZ42gr7xiAdGh2MGf0tXH7KcDKVwqLVKymHrod8BjCL59U8CC-Js_z99jQCZrTIPUCNN_jRyn_TJKBFxNdo=@protonmail.ch
Whole thread Raw
In response to Re: Conditional return of aggregated data  ("Ravi Krishna" <srkrishna@myself.com>)
List 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 by date:

Previous
From: "Ravi Krishna"
Date:
Subject: Re: Conditional return of aggregated data
Next
From: Alban Hertroys
Date:
Subject: Re: Conditional return of aggregated data