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!

Easier Question

Status
Not open for further replies.

sturner333

Programmer
Jan 19, 2004
67
0
0
US
I have asked a question on the forum for what I was trying to do a certain way.
Maybe I should just ask for what I want to do.

I am trying to pick certain records from one table based on data from another record.
Table1 has a column of used idNumbers.
Table2 has a column of ALL idNumbers.
I would like to make a QUERY to list all the non-used idNumbers.

Thanks for the help
 
Use the following SQL code as an example:

select t2.number
from t2 left outer join t1 on t2.number = t1.number
where t1.number is null

John
 
Or another way

SELECT idNumber FROM tblAllNumbers WHERE idNumber NOT IN (SELECT idNumber FROM tblUsedNumbers)

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top