INT 21h

Hi, I am Vladimir Smagin, SysAdmin and Kaptain. Telegram Email / GIT / RSS / GPG

MySQL have IP addresses sorting function out of the box

№ 9046 В разделах: Programming Sysadmin от June 17th, 2018,
В подшивках:

If you sort your IP field as usual it will be sorted like string, but you can use INET_ATON() function to represent IP address string as integers:

SELECT * FROM bot order by INET_ATON(ip) asc

Sample result

Нет комментариев »

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Яндекс.Метрика

Fortune cookie: Evolution is both fact and theory. Creationism is neither.