SQLServer null注意!

来源:互联网 发布:怎样选淘宝上的人参 编辑:程序博客网 时间:2024/04/28 16:53

表A列C的值为 0    1    null

1. 查询A 等于1, select * from A where C = 1

2. 查询A 等于0 与nul,   select * from A where C = 0 and C is null

 

注意:  不能直接使用select * from A where C <> 1

          null <> 1 这个不为真!