mysql> select '10.20.30.40' > '5.6.7.8' as result;
+--------+
| result |
+--------+
| 0 |
+--------+
1 row in set (0.00 sec)
mysql> select inet_aton('10.20.30.40') > inet_aton('5.6.7.8') as result;
+--------+
| result |
+--------+
| 1 |
+--------+
1 row in set (0.00 sec)
mysql>