MySQL 如何查找值是null的记录?
错误方式:
select *from t_table where f_name = null
错误原因:
null 不能和任何值比较,sql中null很任何值比较都不会为真。
解决方法:
select *from t_table where f_name IS null
或
select *from t_table where f_name IS not null
MySQL 如何查找值是null的记录?
错误方式:
select *from t_table where f_name = null
错误原因:
null 不能和任何值比较,sql中null很任何值比较都不会为真。
解决方法:
select *from t_table where f_name IS null
或
select *from t_table where f_name IS not null