当前位置: 代码迷 >> Sql Server >> 语句如何写
  详细解决方案

语句如何写

热度:383   发布时间:2016-04-27 21:52:50.0
语句怎么写
如何查询表里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
  相关解决方案