Oracle Error QSM-02174: the materialized view does not have a UNION ALL marker column

Oracle Error Message

QSM-02174: the materialized view does not have a UNION ALL marker column

Reason for the Error

For a materialized view with UNION ALL to be fast refreshable, it must have a UNION ALL marker column. This is a constant column, at the same ordinal position in each query block and must have distinct values in each query block.

Solution

Add a UNION ALL marker column to each query block in the UNION ALL query defining the materialized view.