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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

easy join? 1

Status
Not open for further replies.

michelleqw

Programmer
Jan 4, 2004
120
DE
Dear sql user,

We are trying to make a join of two tables:

tblX tbly

nr nr
1 3
2
3
4

The result of the join is:

1
2
4

We want to see the result what tbly is missing!

Can someone give us the join?

Nice regards,

Michelle.
 
Same result:

SELECT nr
FROM tblX
WHERE NOT EXISTS (SELECT *
FROM tblY
WHERE tblX.nr = tblY.nr);

 
Another way:
SELECT nr
FROM tblX
WHERE nr NOT IN (SELECT nr FROM tblY)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top