>
> > 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.