日期:2014-05-18  浏览次数:20511 次

以下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)