select count(*) as cnt group by ip order by cnt desc limit 10;
rmck wrote:
Hi,
I have a table with ip,port and I want to see the top ten Ip's with the most entries?
Ip's can be in db many times...
Not the first distinct 10... Im stuck...
I have tried:
mysql> select DISTINCT ip from iptable limit 10;
+---------------+
| ip |
+---------------+
| 0.0.0.0 |
| 10.0.1.42 |
| 10.0.1.8 |
| 10.1.1.1 |
| 10.10.10.1 |
| 10.115.94.193 |
| 10.115.94.195 |
| 10.115.94.40 |
| 10.122.1.1 |
| 10.20.7.184 |
+---------------+
10 rows in set (0.04 sec)
mysql>
But doesn't that just give the first 10 DISTINCT ip's??
rob
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]