SQL检测出ID最高位为非0的语句怎么写?

来源:百度知道 编辑:UC知道 时间:2024/06/02 13:08:58
xID最高位为非0的显示出来的SQL语句,帮我写下:
sql="select * from "&goodstype&" where xID 这里怎么写 "
字段XID类型为:varchar
写错了。。 是检测这个字段数字大于二位并且首位非0的语法,
因为我想显示01至09这几个数啊。
就是输出字段值:01及02 ……1001
不输出:010 最高位为零并且是两位数以上的值。

作比较,这样的性能是很低的。
用not like就行了。

sql="select * from "&goodstype&" where xID not like '0%'

sql="select * from "&goodstype&" where xID left(xID,1) <> '0'"

sql="select * from "&goodstype&" where xID left(xID,1) <> '0' and len(xID) >2 "
这个再试试!

看题意,应该就是两位的排除,首位0的排除,因为都是数字,有个简单的偷懒的写法:
select * from table where xID>'99' and substr(xID,0,1) !='0'