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

Reporting on differences in data

Status
Not open for further replies.

Mich

IS-IT--Management
Dec 26, 2000
452
US
I've got two tables, tab1 and tab2. Each of these tables has a column containing millions of account numbers, tab1.account and tab2.account.

My goal is to see which account numbers from tab1 are not present in tab2. Sounds fairly simple, but I can't get what I'm looking for.

Please help someone that has been given "other job duties as assigned".
 
Never mind, I was reporting on too many fields. The query I'm using now is 'select distinct tab1.account from tab1 where tab1.account not in (select account from tab2)'.

Is there a cleaner way to do this?
 
select distinct tab1.account from tab1 left join tab2
on tab1.account = tab2.account
where tab2.account is null
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top