当前位置: 代码迷 >> ASP.NET >> 以次sql語句哪裏有問題?請各位大蝦幫忙!
  详细解决方案

以次sql語句哪裏有問題?請各位大蝦幫忙!

热度:7890   发布时间:2013-02-25 00:00:00.0
以下sql語句哪裏有問題?請各位大蝦幫忙!急!
語句如下:
select   *   from   Product_db.dbo.File_Publish_Tab   where     Bitem= '文件 '   and   Fno= 'EW-101 '   and   Fver < 'B '   and   FrecY <> 'Y ';
不加and   FrecY <> 'Y '則正確,爲什麽?

------解决方案--------------------------------------------------------
try


select * from Product_db.dbo.File_Publish_Tab where Bitem= '文件 ' and Fno= 'EW-101 ' and Fver < 'B ' and (FrecY Is Null Or FrecY <> 'Y ')
------解决方案--------------------------------------------------------
select * from Product_db.dbo.File_Publish_Tab where Bitem= '文件 ' and Fno= 'EW-101 ' and Fver < 'B ' and (FrecY <> 'Y ' or FrecY is null)
  相关解决方案