MySQL 查询某一字段是否为NULL

****MySQL中查询某一字段是否NULL,切记不可用 =NULL 或者 !=NULL,正确的方式是is null 或者 is not null

1、查询user表中的user_mobile不是NULL的数据

select * from user where user_mobile is not null;

2、查询user表中的user_mobile是NULL的数据

select * from user wher user_mobile is null;

猜你喜欢

转载自blog.csdn.net/u010865136/article/details/81667612
今日推荐