|
楼主 |
发表于 2011-2-23 14:20:44
|
显示全部楼层
行了:
-
- $query = "SELECT * , (CASE when len([Dwg No])=9 then ‘A' else 'B' end) as DrawingNo FROM dbo.Drawings where left([Dwg No],5)='$dwgGroup' and Obsolete='false' and Existance='true' and Appd<>'null' and Sleep='False'";
复制代码
以前用PHP都是用Mysql,MSSQL还是第一次。
最后使用的句子:
-
- $query = "SELECT * , (CASE when len([Dwg No])=9 then left([Dwg No],6) + '0' + right([Dwg No],3) else [Dwg No] end) as DrawingNo FROM dbo.Drawings where left([Dwg No],5)='$dwgGroup' and Obsolete='false' and Existance='true' and Appd<>'null' and Sleep='False' ORDER BY DrawingNo ASC";
复制代码 |
|