我的两个表中已经有 存IP形式的字段varchar型的(58.24.0.0) 和转换后的字段bigint型的
在JSP页面中有两个变量 small和 big 是可以从另一个表中得到的(是IP转换后的bigint型)。rs.getLong( "small ") ....
我想 在页面中这样写个SQL语句
select count(*) from A where ip> small and ip <big (ip也是bigint型的)
SQL可以这样写吗?
在JSP页面中有两个变量 small和 big 是可以从另一个表中得到的(是IP转换后的bigint型)。rs.getLong( "small ") ....
我想 在页面中这样写个SQL语句
select count(*) from A where ip> small and ip <big (ip也是bigint型的)
SQL可以这样写吗?
个人建议最好不要将SQL写在JSP页面上,养成好习惯,将java代码脱离JSP,更何况是连接数据库!
String sql="select count(*) from A where ip>small and ip <big";
这个small和big值怎么在这句SQL中取到???
String sql="select count(*) from A where ip>'"+small+"' and ip<'"+big+"'";