Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting a Nested With Clause error while creating a Table

Chandu VenuSep 16 2021

Hello,
I am trying to create a table from a query. However I am getting the following error:
ORA-32034: unsupported use of WITH clause
32034. 00000 - "unsupported use of WITH clause"
*Cause: Inproper use of WITH clause because one of the following two reasons
1. nesting of WITH clause within WITH clause not supported yet
2. For a set query, WITH clause can't be specified for a branch.
3. WITH clause cannot be specified within parenthesis.
My current Query Structure that's throwing the above error:
With Q2 AS (
SELECT Q1.col1, Q1.col2,Q1.col3
FROM
(Select col1,col2,col3 from table) Q1
),
Q3 AS (
Select Q2.col1,Q2.col2,Q3.col3
FROM Q2
WHERE <conditions>
),
Q4 AS (
Select Q3.col1,Q3.col2,Q3.col3,Q2.col1,Q2.col2,Q3.col3
from Q3 left outer join Q2 on col1 = col1
),
select * from Q4;

Please let me know how I can change my query structure to avoid this error.

Thank you.

This post has been answered by mathguy on Sep 16 2021
Jump to Answer
Comments
Post Details
Added on Sep 16 2021
8 comments
2,860 views