sorry for my english
i have this query to extract domain from urls
SELECT SUBSTRING(LEFT(url, LOCATE(\'/\', url, 8) - 1), 8) AS domain...
The query needs to account for no trailing '/'
IF( LOCATE('/', replace(url,'http://', '') ) > 0 , SUBSTRING(replace(url,'http://', ''), 1, LOCATE('/', replace(url,'http://', '') ) - 1), replace(url,'http://', '')) AS domain