Oracle Error ORA-37418: detail query cannot be derived

Oracle Error Message

ORA-37418: detail query cannot be derived

Reason for the Error

If an ORANIZATION CUBE MV is to automatically derive its loading clause, then its definition query cannot contain set operators (eg UNION ALL), a HAVING clause, START WITH or a SQL MODEL clause. The definition query contains these or other unsupported syntax.

Solution

Use an explicit ORGANIZATION CUBE clause, or simplify the defining query.