How to match an ip address in mysql?

后端 未结 5 1006
無奈伤痛
無奈伤痛 2021-01-04 23:15

For example, I am having a column storing data like this.

Apple
12.5.126.40
Smite
Abby
127.0.0.1
56.5.4.8
9876543210
Notes

How to select ou

5条回答
  •  佛祖请我去吃肉
    2021-01-04 23:47

    you could also use the useful function inet_aton()

    SELECT *
    FROM yourtable
    WHERE inet_aton(thecolumn) is not null
    

提交回复
热议问题