I was trying to do "ORDER BY ip" query and failed.
SELECT ip FROM test ORDER BY IF (ip RLIKE '\\.[0-9]{1}$', INSERT(ip,8,2,'0'), INSERT(ip,8,1,'0'))
I get ip numbers with one digit at the end first, but they are not in ascending order. Why?
10.0.0.6
10.0.0.8
10.0.0.9
10.0.0.1
10.0.0.2...