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!

with / inlineview

NaamasMar 13 2016 — edited Mar 14 2016

Hi all ,

my first question in the with clause also called an inline view ?

my second question is :

i have a query with WITH clause .

like this :

with a (

select * from employees_salary

where department_id = 10

union all

(select *

from  employees_salary

where department_id = 20

and category = 21

minus

select *

from  employees_salary

where department_id = 20

and category = 22  ))

select * from a

minus

select * from a

where a.start_date =  trunc(sysdate)


unfortunately i can't use the with clause with pl/sql .

so  i'm  replacing the WITH with the inline view .

like this :

select * from

(select * from employees_salary

where department_id = 10

union all

(select *

from  employees_salary

where department_id = 20

and category = 21

minus

select *

from  employees_salary

where department_id = 20

and category = 22  )) a

minus

select * from

(select * from employees_salary

where department_id = 10

union all

(select *

from  employees_salary

where department_id = 20

and category = 21

minus

select *

from  employees_salary

where department_id = 20

and category = 22  )) a

where a.start_date =  trunc(sysdate)

i multiply the inline view a twice vs . the WITH clause which i wrote it once .

is there a way of not multiple the inline view ?

Thanks In Advanced

Naama.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 11 2016
Added on Mar 13 2016
20 comments
3,795 views