Thread: ERROR: aggregate function calls cannot be nested

ERROR: aggregate function calls cannot be nested

From
Jonathan Blitz
Date:
Hi,
I am getting the message 'ERROR: aggregate function calls cannot be nested" when using a select from an inner select.
 
The outer select had a group by clause but the inner one is a straight join between a few tables.
 
What exactly does this message mean?
 
Jonathan Blitz

Re: ERROR: aggregate function calls cannot be nested

From
Tom Lane
Date:
Jonathan Blitz <jblitz@013.net> writes:
> What exactly does this message mean?

It means you can't write something like avg(sum(x)).

            regards, tom lane