select t.args1,t.args2,t.args3 from beyond t ;

select t.args1,t.args2,t.args3 from beyond t where t.args2 != null ;

select t.args1,t.args2,t.args3 from beyond t where t.args2 = null ;
这两种情况竟然查出来是 Null ,没有报错!
select t.args1,t.args2,t.args3 from beyond t where t.args2 != 'null'

注: 不仅把NUll值排除掉了,还把 值为“null"的排除掉了,用 mysql 的 null 做判断的时候,需谨慎!
本文探讨了在SQL查询中处理NULL值的方法,包括排除NULL值和非NULL值(包括具体值如'null')的技巧,强调了在进行NULL值判断时需要注意的事项。
461

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



