hello, I have a large database that contains many urls, there are many domains repeating and i;m trying to get only the domain. eg:
http://example.com/someurl.html
http://example.com/someurl_on_the_same_domain.html
http://example.net/myurl.php
http://example.org/anotherurl.php
and i want to get only domains, eg:
http://example.com
http://example.net
http://example.org
My query is:
SELECT
id
,site
FROMtable
GROUP BYsite
ORDER BYid
DESC LIMIT 50
I need to use regex i think but i'm not mysql guru.