Sql 中 不等于'<>'与 NULL

SQL 条件语句使用不等于‘<>’的筛选条件,会将字段为null的数据也当做满足不等于的条件而将数据筛选掉。

id name
1 1
2 2
3 null

用 select * from table where name<>1查询时得到的结果为:

id name
1 1
2 2
3 null

猜你喜欢

转载自www.cnblogs.com/chuningning/p/9166147.html