oracle - With clause not working with union -
my query result union of several queries. facing below error when use clause within union. ideas why?
select column1 table_a union abcd (select * table_b) select column2 table_a a, abcd abcd.m_reference = a.m_reference
ora-32034: unsupported use of clause
32034. 00000 - "unsupported use of clause"
*cause: inproper use of clause because 1 of following 2 reasons
1. nesting of clause within clause not supported yet
2. set query, clause can't specified branch.
3. clause can't sepecified within parentheses.
*action: correct query , retry
just define cte first, before actual union
query. use regular table:
with abcd (select * table_b) select column1 table_a union select column2 table_a inner join abcd on abcd.m_reference = a.m_reference
you can use multiple cte follows:
with cte1 (...), cte2 (...) select * ...
Comments
Post a Comment