Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.
Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.
Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.
It's been a while since i used MySQL but would something like this work?
SELECT ColumnName, COUNT(ColumnName) AS ColumnName_Count
FROM table_name
GROUP BY ColumnName
ORDER BY ColumnName_Count DESC;
Loop through the rows - explode the sentence into words - increment an associative array of the words. At the end you'll have an array of all the words and their count.
SELECT
COUNT(*) as num,
SUBSTRING_INDEX(SUBSTRING_INDEX(logs.useragent, ' ', numbers.n), ' ', -1) logs
FROM
(SELECT 1 n UNION ALL SELECT 2
UNION ALL SELECT 3 UNION ALL SELECT 4) numbers INNER JOIN logs
ON CHAR_LENGTH(logs.useragent)-CHAR_LENGTH(REPLACE(logs.useragent, ' ', '')) >= numbers.n-1
GROUP BY logs
ORDER BY num DESC
LIMIT 20;
+-------+-----------------------------------------+
| num | logs |
+-------+-----------------------------------------+
| 38314 | Mozilla/5.0 |
| 17251 | (compatible; |
| 12233 | NT |
| 12211 | (Windows |
| 7452 | MSIE |
| 6167 | 6.1; |
| 5831 | U; |
| 5718 | Mozilla/4.0 |
| 5379 | Linux |
| 5367 | (X11; |
| 4365 | Windows |
| 4355 | (Windows; |
| 4014 | Googlebot/2.1; |
| 4007 | +http://www.google.com/bot.html) |
| 3822 | x86_64) |
| 3581 | Stratagems |
| 3581 | Kumo |
| 3205 | |
| 2821 | http://www.nominet.org.uk/privacypolicy |
| 2803 | (Macintosh; |
+-------+-----------------------------------------+
We use essential cookies to make this site work, and optional cookies to enhance your experience.