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!

Query Help: records in table X but not in Y. 1

Status
Not open for further replies.

AlexTekTip

Programmer
Aug 30, 2004
17
US
I have two tables (X and Y). They both have column ITEM.

Y.ITEM must exist in X.ITEM

X.ITEM does not need to exist in Y.ITEM

I need a query that will give me a list of

X.ITEM's not in Y.


Thank You.
 
nevermind...

select x.item
from table1 a
where item not in (select unique item from table2)

 
Left outer join with NULL predicate in the Where clause will work too.

select x.item
From x left outer join y
on x.item = y.item
Where y.item is null
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top