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

finding missing data records.

Status
Not open for further replies.

cb49747

MIS
Apr 23, 2002
181
US
hello,

I'm trying to write a query that will show what records are missing from a table.

table A has inv_num and ln_num
table B has inv_num

In table A there can be only one ln_num but multiple inv_num.

In table B there can only be one inv_num.

for every different inv_num in table A there needs to be a corresponding record in table B.

what I need is how to write a query that will tell me if I get a inv_num that does not have corresponding record in table B.

Thanks for any help on this.
 
select a.inv_num,b.inv_num from a left outer join b on a.inv_num=b.inv_num where b.inv_num is null and a.inv_num is not null

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top