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

Find Unmatched Name Where Duplicate SSN ?

Status
Not open for further replies.
Jun 29, 2001
195
US
Here's my issue. I need to find names that don't match but with same SSN. Example:

SSN NAME
123456789 Ashley Rickards
123456789 Bob Smith

TIA Ashley L Rickards
SQL DBA
 
how about
Code:
SELECT A.SSN, A.LastName, A.FirstName, B.LastName, B.FirstName
FROM
insert table name here
Code:
 AS A INNER JOIN
insert table name here
Code:
 AS B ON A.SSN = B.SSN
WHERE (A.LastName <> B.LastName) OR (A.FirstName <> B.FirstName)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top