Oracle Error QSM-02041: nested aggregate function

Oracle Error Message

QSM-02041: nested aggregate function

Reason for the Error

The capability in question is not supported when the materialized view nests an aggregate function invocation as an argument to another aggregate function.

Solution

Re-phrase the query to avoid the nested aggregate function invocation.