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!

Not in Vs Not Exsists

S567Jan 4 2019 — edited Jan 4 2019

Hi Expert's

I wouldl like to understand how not exists works in backend.

I have two tables table1 and table2 where feild1 in table1 is matching to feild2 in table2.

Now i am just trying to fetch data from  table1 which are not in table2.However the below both sqls will give same result i want to understand in second sql we havnt gave any reference to match the feild2 i mean the way how we give in first sql like feild1 Not in Feild2,then how does the matching does in NOT exsists ?

select * from table1 where feild1 

not in (

select feild2 from table2 );

select * from table1 where not exists (

select feild2 from table2 );

Thanks,

shiva

Comments
Post Details
Added on Jan 4 2019
3 comments
444 views