Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Finding persons without using a unique identifier

Author  Topic 

velvettiger
Posting Yak Master

115 Posts

Posted - 2009-11-10 : 14:14:08
I have a file which contains first and last names only, lets call this list customer1. I need to find those customers who are in customer1 that are not in the main database.

Customer1 does not have any unique identifier, so I would need to use the first and the last name together.

Can this be done????

Customer1 -Looks like this

firstname Lastname
Alexis Garcia
Darlene Greaves
Delcina Blackman


MainTable

Cardnumber firstname lastname
1 Amanda Morris
2 Mary Amos
3 Justin Gill
4 Darlene Greaves
5 Mary Amos

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-10 : 14:19:06
select * from customer1 as c1
where not exists(select * from MainTable where firstname=c1.firstname and lastname=c1.lastname)



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

velvettiger
Posting Yak Master

115 Posts

Posted - 2009-11-12 : 10:15:53
Thanks a million :)
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2009-11-12 : 11:36:26
Understanding of course that John Smith or Jet Li, etc may be many different people



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -