比如有如是表
Tab
Code //char型
0120348271
0120348261
0120348671
0120348221
0120348211
0120341451然后我要查询出 大于 120348261 小于0120341451 的记录
我用select * from tab where code > '120348261' and code < '0120341451'
不行
有什么办法
Tab
Code //char型
0120348271
0120348261
0120348671
0120348221
0120348211
0120341451然后我要查询出 大于 120348261 小于0120341451 的记录
我用select * from tab where code > '120348261' and code < '0120341451'
不行
有什么办法
from tab
where code < '0120348261' and code > '0120341451'
from tab
where code < '0'+'120348261' and code > '0120341451' 加上一个0罗,呵呵~来偷点分
直接转换成bigint比较吧