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

语句怎么写
如何查询表里A字段的前四个字符是:1001的所有记录

------解决方案--------------------
select * from tablename where left(column_name,4) = '1001 '
------解决方案--------------------
如何查询表里A字段的前四个字符是:1001的所有记录

SELECT * FROM 表 where substring(a,1,4)= '1001 '
------解决方案--------------------
select * from tablename where substring(column_name,1,4) = '1001 '
------解决方案--------------------
都可以。。。。

晕了
------解决方案--------------------
select * from tablename where column_name like "1001% "
------解决方案--------------------
ls的都正解...
------解决方案--------------------


select * from tbName where colName like '1001% '
------解决方案--------------------
select * from tbName where charindex( '1001 ', colName)=1