How to fix the Oracle error ORA-36266: (XSCGMDLAGG00) Invalid context for the AGGREGATION function?

In this post, you’ll learn more about the Oracle ErrorORA-36266: (XSCGMDLAGG00) Invalid context for the AGGREGATION function with the details on why you receive this error and the possible solution to fix it.

Oracle Error Description

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

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

The AGGREGATION function was used outside of the MODEL context.

How to fix the Error ORA-36266: (XSCGMDLAGG00) Invalid context for the AGGREGATION function ?

You can fix this error in Oracle by following the below steps

Use AGGREGATION only in a model.