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

Join Issue... Find records in Table1 NOT IN Table2??? 1

Status
Not open for further replies.

wellster34

Programmer
Sep 4, 2001
113
CA
Hi,

I have two tables (TABLE1 and TABLE2) and they have 3 columns that are the unique key in each. These unique columns are the same in each table.

My question/issue is how to get the records in TABLE1 NOT IN TABLE2???

I did a manual check and I know there are 2 records in TABLE1 not in Table2. Every query I have tried I can not seem to use the Outer or Inner joins... I keep getting ALL records.

select * from TABLE1 A, TABLE2 B
WHERE A.COL1 = B.COL1 (+) AND
A.COL2 = B.COL2 (+) AND
A.COL3 = B.COL3 (+);



Thanks for your time
[dazed]

 
if you just want the keys

select COL1, COL2, COL3 from TABLE1
minus
select COL1, COL2, COL3 from TABLE2;



I tried to remain child-like, all I acheived was childish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top