On Wed, 2008-07-23 at 12:10 -0400, [EMAIL PROTECTED] wrote: > Yes, sorry. I have a database that records ip of attacks on a customer > server, what I like to do get a count so that I can see what subnet is > doing the major of the attacks. > > select ip from ipslimit 10; > +-----------------+-----------+ > | ip | count(ip) | > +-----------------+-----------+ > | 83.117.196.206 | 1 | > | 85.17.109.28 | 1 | > | 125.138.96.19 | 1 | > | 89.110.148.253 | 1 | > | 192.168.105.10 | 1 | > | 200.170.124.72 | 1 | > | 201.116.98.214 | 1 | > | 202.168.255.226 | 1 | > | 203.89.243.158 | 1 | > | 210.245.207.217 | 1 | > +-----------------+-----------+ > 10 rows in set (0.00 sec)
select substring( '83.117.196.206', 1, length( '83.117.196.206' ) - locate( '.', reverse( '83.117.196.206') ) ); Of course, replace '83.117.196.206' with the column name. -- Just my 0.00000002 million dollars worth, Shawn "Where there's duct tape, there's hope." -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]