cnu_raop Posted January 31, 2018 Report Posted January 31, 2018 i need to find out duplicate members based on their firstname, lastname, dob, zipcode. I need to write a query to list out the duplicates even if the first name, last name matches 70% but have the same dob and zip. example, i have two records with first name PAVAN and PAWAN with same last name and dob (this is a duplicate), so i want to bring not only the exact match of the first last name, dob and zip but also if the first and last name matches 70% and both records have the same dob and zip. Record 1: Firstname: PaVan, Lastname: Kalyan, DOB: 01/01/1985, Zip:00000 Record 2: Firstname: PaWan, Lastname: Kalyan, DOB: 01/01/1985, Zip:00000 pls help.. Quote
Bhai Posted January 31, 2018 Report Posted January 31, 2018 4 minutes ago, cnu_raop said: i need to find out duplicate members based on their firstname, lastname, dob, zipcode. I need to write a query to list out the duplicates even if the first name, last name matches 70% but have the same dob and zip. example, i have two records with first name PAVAN and PAWAN with same last name and dob (this is a duplicate), so i want to bring not only the exact match of the first last name, dob and zip but also if the first and last name matches 70% and both records have the same dob and zip. Record 1: Firstname: PaVan, Lastname: Kalyan, DOB: 01/01/1985, Zip:00000 Record 2: Firstname: PaWan, Lastname: Kalyan, DOB: 01/01/1985, Zip:00000 pls help.. @Balibabu Quote
Amrita Posted January 31, 2018 Report Posted January 31, 2018 https://stackoverflow.com/questions/9198160/finding-duplicate-names-where-first-name-can-be-an-initial-or-full-name https://stackoverflow.com/questions/9849846/find-duplicate-records-in-a-table-using-sql-server http://www.tech-recipes.com/rx/49959/finding-duplicate-records-using-group-by-in-sql-server/ http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=54977 Exactly not the one u want but similar. Tweak and write ur own sql. Quote
boeing747 Posted January 31, 2018 Report Posted January 31, 2018 ( SELECT lname, fname FROM [Employee] WHERE lname != ' 'AND fname != ' ' GROUP BY lname, fname HAVING COUNT(lname) > 1 and COUNT(fname) > 1) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.