Oracle Error ORA-36266: (XSCGMDLAGG00) Invalid context for the AGGREGATION function

Oracle Error Message

ORA-36266: (XSCGMDLAGG00) Invalid context for the AGGREGATION function

Reason for the Error

The AGGREGATION function was used outside of the MODEL context.

Solution

Use AGGREGATION only in a model.