日期:2014-05-19  浏览次数:20575 次

|M| SQL查字符串的要怎么来查啊
比如有如是表
Tab  
Code       //char型
0120348271
0120348261
0120348671
0120348221
0120348211
0120341451

然后我要查询出   大于   120348261   小于0120341451   的记录
我用select   *   from   tab   where   code   >   '120348261 '   and   code   <   '0120341451 '
不行
有什么办法

------解决方案--------------------
应该可以..
------解决方案--------------------
--是 小于 0120348261 大于0120341451 吧

select *
from tab
where code < '0120348261 ' and code > '0120341451 '

------解决方案--------------------
select *
from tab
where code < '0 '+ '120348261 ' and code > '0120341451 ' 加上一个0罗,

呵呵~来偷点分