Oninit Logo
The Down System Specialists
+1-913-674-0360
+44-2081-337529
Partnerships Contact
Finderr

-8105 Aggregates may not be used within another aggregate. Nor may

aggregates be used within the WHERE clause of another aggregate.

Aggregate functions cannot be nested, primarily because the value of the inner aggregate is not known while the outer aggregate is being accumulated. Rewrite aggregate expressions to refer only to columns and simple expressions on columns. In an AFTER GROUP OF clause, you can save the aggregate value from one group of rows in a variable in order to use it to compute an aggregate over a subsequent group.