码迷,mamicode.com
首页 > 数据库 > 详细

mysql中查询字段为null或者不为null的sql语句怎么写?

时间:2018-11-24 17:58:44      阅读:1163      评论:0      收藏:0      [点我收藏+]

标签:怎么   from   log   sch   span   color   where   ble   不为   

在mysql中,查询某字段为空时,切记不可用 = null,
而是 is null,不为空则是 is not null

select * from table where column is null;

select * from table where column is not null;

select * from s_class_log WHERE class_uuid="50f3b8ecde184f22ac6bd7304b388b60" AND course_schedules_uuid="940991bff18d4122a4a6471b61ef18f2" and  remark_status is not null

mysql中查询字段为null或者不为null的sql语句怎么写?

标签:怎么   from   log   sch   span   color   where   ble   不为   

原文地址:https://www.cnblogs.com/sonder/p/10012678.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!