So here's what worked for me:
SELECT Url = SUBSTRING(SourceUrl,0,CHARINDEX('.',SourceUrl,0))
FROM
(
SELECT SourceUrl = REPLACE(REPLACE(REPLACE(REPLACE(SourceUrl, 'http://www.',''), 'https://www.',''),'https://',''),'http://','')
FROM myUrlTable
) urlData
Comments and improvements are welcome and I hope someone finds this useful!
No comments:
Post a Comment