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!

Nested With Clause issue

user518071Jun 15 2016 — edited Jun 16 2016

Hi,   I've a query

Select * from (with x as (select  c.a1,c.a2......from t1,t2  where t1.id = t2.id)

      

      select  y.s1,

                 y.s2

                   .

                   .

             from (select n.d1,n.d2  from n) y

      where clause for query1)

UNION

Select * from (with x as (select  c.a1,c.a2......from t1,t2  where t1.id = t2.id)

      

      select  y.s1,

                 y.s2

                   .

                   .

             from (select n.d1,n.d2  from n) y

   where clause for query2)

UNION

   Select * from (with x as (select  c.a1,c.a2......from t1,t2  where t1.id = t2.id)

      

      select  y.s1,

                 y.s2

                   .

                   .

             from (select n.d1,n.d2  from n) y

   where clause for query3)       

Hi,   I've a query    

Here except where clause query criteria is same for all those queries Is there any simple way to write this query without repeating query criteria thrice. Thanks, Kiran

Here except where clause, query criteria is same for all those queries.

Is there any simple way to write this query without repeating query criteria thrice.

Thanks,

Kiran

This post has been answered by Barbara Boehmer on Jun 16 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 14 2016
Added on Jun 15 2016
4 comments
1,446 views