I have a table that had a manual entry field which I am now trying to clean up and create a lookup table for. My problem is that there are multiple entries all of which are incredibly similar to each other but not exact. This is causing me problems because there are over 1000 vendors in my list and about 1/3 of them are very similar but are not duplicates.Below is a sample of my query and data output. What I would like is one query which aggregates all of the similar items and places them into a single row with an ID field to create a cleaned lookup table so that there is 1 row per name.My Question…Is there any way to do this without writing 500 case statements in the query?Here is what I have nowselect distinct top 7 [Vendor Name]from dbo.[Part Numbers]where [Vendor Name] is not nullorder by [Vendor Name]
ResultsVendor Name-------------------------------------------------- K&L MICROWAVE INCABLE ELECTRONICSACCESS FLOORING SUPPLIESACCURATE SCREWACCURATE SCREW MACHINEACCURATE SCREW MACHINE COACCURATE SCREW MACHINE CO.(7 row(s) affected)
Here is what I would like the data to become.ID Vendor Name--------------------------------------------------1 ABLE ELECTRONICS2 ACCESS FLOORING SUPPLIES3 ACCURATE SCREW MACHINE CO.etc...
JBelthoff› As far as myself... I do this for fun!