sql中判断非空不能用等号,因为null在sql中被看作特殊符号,必须使用关键字 is和not select * from A where info is not null
非空:
select id,info from 表名 where info is not null;
空:
select id,info from 表名 where info is null;
本文介绍了在SQL中如何正确地进行非空判断的方法。由于NULL值的特殊性,不能使用等号来判断是否为空,而应该使用IS NOT NULL关键字。文章通过具体的SQL语句示例展示了如何实现这一操作。
sql中判断非空不能用等号,因为null在sql中被看作特殊符号,必须使用关键字 is和not select * from A where info is not null
非空:
select id,info from 表名 where info is not null;
空:
select id,info from 表名 where info is null;
7592

被折叠的 条评论
为什么被折叠?