select count(*) from pw_points_b2c where coalesce<=>null;这样去两个库查询看看。你上面的语句和<=>NULL是相同的结果。
写错了。不好意思。。 应该是这样的。 select count(*) from pw_points_b2c where pw_downdate<=>null;
select pw_downdate,length(pw_downdate) from pw_points_b2c; select pw_downdate,length(pw_downdate) from pw_points_b2c where downdate=''; select pw_downdate,length(pw_downdate) from pw_points_b2c where downdate<=>null;可能是存了有空字符进去,看起来是空的,其实不是NULL。
应该是这样的。
select count(*) from pw_points_b2c where pw_downdate<=>null;
select pw_downdate,length(pw_downdate) from pw_points_b2c where downdate='';
select pw_downdate,length(pw_downdate) from pw_points_b2c where downdate<=>null;可能是存了有空字符进去,看起来是空的,其实不是NULL。