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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Showing - almost - duplicate rows

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2007-01-15 : 11:07:16
Per writes "Hi SQLTeam

I have searched for days now, both in BO, your forum and articles, google you name it... but have not found the solution yet and I am about to give up :-(
My problem is that I have a list of 5000+ rows in a database, and there are rows that are almost duplicate values.

The layout is ProductID and ProductName. In the ProductName it could be something like

Fruity Loops
Fruiti Loops
Fruity Loops.
Fruity loop
fruity loop .

I have created something that will show exact duplicates, but this is not what I want:

SELECT A.ProductID,A.ProductName
FROM Products A
JOIN (
SELECT ProductID, ProductName FROM Products GROUP BY ProductName,ProductID HAVING COUNT(*) > 1) B on A.ProductName = B.ProductName Order BY A.ProductName

I thought of using SOUNDEX, but I failed miserably trying to accomplish this...

Hope you will give it a try."

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-01-15 : 11:20:11
this might be of use:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=51540



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -