I need help with a PostgreSql query. I need to find all parcels which have bigger area then average. I'm using this query:
SELECT OBJECTID
FROM parcela
WHERE ST_Area(geom)<(SELECT Sum(ST_Area(geom)/count(*)))
GROUP BY OBJECTID;
but it gives me error:
aggregate function calls cannot be nested
I tried few different ways to solve this (using 'having' instead 'where' etc.) but always some new error occurs. Can anybody please tell me how to write right query to get this information. Thanks