判断null

1
2
3
4
5
-- 查询手机号不为null的用户数据
mysql> SELECT * from user where phone is not null;

-- 查询手机号为null的用户数据
mysql> SELECT * from user where phone is null;