sql语句:看我写的sql语句为什么语法不对呢?

来源:百度知道 编辑:UC知道 时间:2024/06/19 02:42:32
select country,city from ip where '123'>=CAST(`ip1` AS float) and '123'<=CAST(`ip2` AS float)

第一数字的比较是不用加''的。第二float的换成signed或是unsigned

select country,city from ip where CAST(`ip1` AS float)<= '123'and CAST(`ip2` AS float)>='123'

首先看看你的字段名,表名对不对。123是什么啊?