Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Duplicate values
Message
 
 
To
16/09/2004 09:31:16
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00942860
Message ID:
00942891
Views:
25
This message has been marked as the solution to the initial question of the thread.
>I would like to consider them duplicates.

It may not be most efficient way but it should provide you with starting point. Try
SELECT * 
	FROM mytable
	WHERE CAST(SUBSTRING(col1, PATINDEX('%[0-9]%', col1), 7) AS int) IN (
SELECT NumPart 
	FROM (
		SELECT *, CAST(SUBSTRING(col1, PATINDEX('%[0-9]%', col1), 7) AS int) AS NumPart
				FROM mytable ) dt1
	GROUP BY NumPart
	HAVING COUNT(*) > 1)
	ORDER BY CAST(SUBSTRING(col1, PATINDEX('%[0-9]%', col1), 7) AS int)
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform