详解mysql不等于null和等于null的写法
时间:2021-05-20 09:29:11|栏目:Mysql|点击: 次
1.表结构
2.表数据
3.查询teacher_name字段不能等于空并且也不能等于空字符
SELECT * FROM sys_teacher WHERE teacher_name IS NOT NULL AND teacher_name <>''
查询结果:
4.查询teacher_name字段等于null或等于空字符
SELECT * FROM sys_teacher WHERE teacher_name = '' OR teacher_name IS NULL
查询结果: