Oracle Error QSM-02117: missing GROUPING_ID or GROUPING functions on GROUP BY column(s)

Oracle Error Message

QSM-02117: missing GROUPING_ID or GROUPING functions on GROUP BY column(s)

Reason for the Error

The capability in question is not supported when the materialized view uses grouping sets but omits the relevant GROUPING_ID or GROUPING functions.

Solution

Re-phrase the query to include the relevant GROUPING_ID or GROUPING functions.