We help IT Professionals succeed at work.

Select Missing Rows From Table (Determination Made Based on Multiple Columns)

359 Views
Last Modified: 2012-05-08
Greetings, I need some expert help.  I have two tables and I need to find rows in table #1 that are missing in table #2.  To determine what is "Missing" I need to search multiple columns.  Here is an Example of my table structure:

Table_1
--------------------
Table_1_Unique_ID  (int)
PIN (varchar(6))
AIN (varchar(9))
TypeID (int)

Table_2
--------------------
Table_2_Unique_ID (int)
PIN (varchar(6))
AIN (varchar(9))
TypeID (int)


Since Table_2 doesn't have Table_1_Unique_ID as a foreign key, I guess I need to make the mix of PIN/AIN/TypeID act like the key in order to find rows that are missing from Table_2... I just don't know how to do that.

Thank you in advance for your help!
Comment
Watch Question

SQL Server DBA & Architect, EE Solution Guide
CERTIFIED EXPERT
Awarded 2009
Distinguished Expert 2019
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
That is great!  Thank you so much for your fast response!
Raja Jegan RSQL Server DBA & Architect, EE Solution Guide
CERTIFIED EXPERT
Awarded 2009
Distinguished Expert 2019

Commented:
Welcome..
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.