Referring from Here
BUG 768478
The message "ORA-00928: missing SELECT keyword
" can occur when Oracle cost-based optimization attempts to rewrite a query that contains a set operator (e.g. UNION, MINUS
, or INTERSECT
) with a materialized view.
There are three workarounds:
1. Disable query rewrite with an "ALTER {SESSION|SYSTEM} DISABLE QUERY REWRITE
" statement.
2. Use a NOREWRITE
hint with all SELECT
statements referenced by the set operator.
3. Use a REWRITE(mv)
hint with all SELECT
statements in the set operator to tell the optimizer to explicitly use a materialized view.
Scalar expressions
referencing SQL factoring elements ( WITH
... AS
) are not fully supported within view's subqueries. Acessing it locally work fine but remote access via dblinks
errors out every time.