在字段等值比对时可能会出现null=null的情况,如果用=判断则null=null返回的是false
使用<=>解决
两种关键字进行对比
select case when null = null then 'true' else 'false' end 等于关键字;
select case when null <=> null then 'true' else 'false' end 改变关键字;
使用IFNULL(expr1,expr2)函数转化
select case when IFNULL(null,'') = IFNULL(null,'') then 'true' else 'false' end 等于关键字;