Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to make Query to Select Child Without Parrent

Status
Not open for further replies.

angjbsca

Programmer
May 26, 2006
30
PR
Hi here Again... I have a 2 tables Parent,child... I need to take out all the records with Child without Parent and viceversa,,,right now I'm doing with left join but take much time because those tables are huge.my question is ..exist another other way to acomplish that?

 
You should consider having a relationship on the tables so that this kind of problem does not occur.
 
here my join, how I can change to Not exists logic?.

select a.bd,a.bt,a.bq,a.sm
from mm a
left join md b
on a.bd = b.bd and
a.bt = b.bt and
a.bq = b.bq and
a.sm = b.sm
where b.bd is null
and b.bt is null
and b.bq is null
and b.sm is null
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top