原帖由 vinhlam 于 2009-2-24 22:13 发表
现在就是有点儿头痛,如果INET_ATON(IP)算出的值在0~2147483647之间,则不变,如果在2147483648至4294967295之间,则需要送去4294967296,不知这个表达式怎么写。
select if (INET_ATON(a.`ip_start`) < 2147483647,INET_ATON(a.`ip_start`),4294967295) as ip_start , if (INET_ATON(a.`ip_end`) < 2147483647,INET_ATON(a.`ip_end`),4294967295) as ip_end from `t_province_ip_new` a |
mysql> select INET_ATON("203.200.235.191") - - - 4294967296 -> ; +-----------------------------------------------+ | INET_ATON("203.200.235.191") - - - 4294967296 | +-----------------------------------------------+ | -876024897 | +-----------------------------------------------+ 1 row in set (0.00 sec) mysql> |
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |