SQL Server Where 条件中 != 是否能查询出 为null的数据

有个需求查找表格中 状态(status) 不是 1的数据。我们很容易从字面意思写出第一条SQL ,然而得到的结果不是我们想要的。

select  * from   tableTmp  where Status != 1   

以下 SQL 语句中 才是最终需要的结果

select  * from   tableTmp  where Status != 1   or  Status  is null 

select  * from   tableTmp  where   isnull(Status  ,0)  <>1

原文地址:https://www.cnblogs.com/ITyueguangyang/p/15018791.html