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!

Select data from table not in another table

HarveyNov 3 2009 — edited Nov 3 2009
Hi,

I want to select data from table A which is not in table B.

Currently I am doing:

select
snoA,
nameA,
dobA
from A
where snoA not in
(select snoB from A, B
where snoA = snoB
and nameA = nameB)

But above is very slow.

Can I do something like:

select
snoA,
nameA,
dobA
from A, B
where
EXCLUDE ( snoA = snoB and nameA = nameB)

Please note that I need the where condition on both the columns.

any help will be appreciated.

-- Harvey
This post has been answered by JustinCave on Nov 3 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 1 2009
Added on Nov 3 2009
5 comments
9,798 views