详解mysql不等于null和等于null的写法

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

查询结果:

到此这篇关于详解mysql不等于null和等于null的写法的文章就介绍到这了,更多相关mysql不等于null和等于null内容请搜索云海天教程以前的文章或继续浏览下面的相关文章希望大家以后多多支持云海天教程!

原文链接:https://blog.csdn.net/demo_gsl/article/details/95500438