大家好,我想查询一个字段,一共Varchar2(16)类型,现在的值是FY02600000012345至FY02690000054321我现在想说一下:FY02(60)这里的60可以变的,可以20,70,80,后面的数字是顺序增加,我想问一下怎么查询FY02这四位字母一样,后面10位数字顺序增加的.
select * from aaa where vchcode >='FY02600000012345' and vchcode<=FY02690000054321' 也会查询出:FY02700000000004
select * from aaa where vchcode >='FY02600000012345' and vchcode<=FY02690000054321' 也会查询出:FY02700000000004
我在自己机子上建表t(id int,name var(2))
insert into
'FY02600000012345'
FY02690000054321'
FY02700000000004
三条数据
select * from t where name >='FY02600000012345' and name <='FY02690000054321'
结果
1 FY02600000012345
2 FY02690000054321