I am trying to find duplicate data, including data with double or multiple spaces between the words that makes up the names. This is in SQL Server
Example:
Product Names in a Product Table:
Lime Cola
Lime Cola
Lime Cola
This query will return just the first two, but not the third one:
SELECT * FROM [DBNmae].[dbo].[TableName] WHERE [productname] IN (SELECT [productname] FROM [DBName].[dbo].[TableName] GROUP BY [productname] HAVING COUNT(*) > 1)
How can I adjust the query to return all three?
That means, the double or multiple spaces within "Lime Cola" should be ignored.
Thanks,
Cypray