表Table
codes names
01 1
0101 1_1
0102 1_2
02 2
0201 2_1
0202 2_2
03 3
0301 3_1
0302 3_2
我查询出两位数
select * from table where len(codes)>0 and len(codes)<3
codes names
01 1
02 2
03 3
然后想查出前两位数为01的项
就是想查询结果为
codes names
0101 1_1
0101 1_2
求大神指教啊!!!!!!
------解决方案--------------------
select * from #test where LEFT(codes,2)='01'