I have a MySQL table with a column of well-formed URLs. I'd like to get a table of the unique domain names in the column, and the number of times each domain appears. Is there a MySQL query that can do this?
I thought of doing something like...
SELECT COUNT(*)
FROM log
GROUP BY url REGEXP "/* regexp here */"
...but this doesn't work as REGEXP returns 0 or 1 and not what was matched.