SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Return single entry when address field is alike
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jbasso
Starting Member

USA
2 Posts

Posted - 06/21/2012 :  18:26:00  Show Profile  Reply with Quote
I am trying to clean up a table that has 500,000 entries. The table consists of data where the entries were saved via an import program written in C++ which I have no control over.

The problem is the program is creating almost duplicate entries when the name or address field are not exactly like a current entry.

Sample:
ID SubID Name Address
12345 X001 Green, Robert Jr 123 N. First Street
12345 X002 Green, Robert Jr. 123 N. First Street
12345 X003 Green, Robert Jr. 123 N 1st Street
12345 X004 Green, Robert 456 S. 3rd Street
12345 X005 Green, Janice 456 S. 3rd Street

It has to do with how the data is entered in the file that is imported which again I have no control over.

Not sure if I posted in the wrong area or if there just hasn't been anyone that can answer this yet so I re-posting it here.

What is my best option to report/cleanup so a query would return the truly unique records, such as:

ID SubID Name Address
12345 X001 Green, Robert Jr 123 N. First Street
12345 X004 Green, Robert 456 S. 3rd Street
12345 X005 Green, Janice 456 S. 3rd Street

Any one of the 3 in the sample that are matches would be acceptable to return.

Thanks in advance for any help.

visakh16
Very Important crosS Applying yaK Herder

India
47023 Posts

Posted - 06/21/2012 :  19:49:35  Show Profile  Reply with Quote
you might have to define rules using which you need to identify similar ones and return unique fields

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000