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

HOW TO FIND MISSING NUMBER IN TABLE

Status
Not open for further replies.

pelagic

Programmer
Nov 7, 2002
97
US
Hi there,

I have 2 tables, which have the following data
table1
SerialNo
2
4
6

table2
SerialNo
1
2
3
4
5
6

Is there a way to find missing numbers from table1 base on table2? In this case the missing numbers from table1 is
1
3
5

Thanks alot.
pel
 
SELECT SerialNo FROM table2
WHERE SerialNo NOT IN (SELECT SerialNo FROM table1)

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
If you don't understand RickSpr 's soloution, you might be able to use the "un-Matched" wizard and just follow the prompts.




MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top