您好,欢迎访问一九零五行业门户网

MySQL“IS NULL”和“IS NOT NULL”有什么好处?

我们知道,在使用 null 和比较运算符时,我们不会得到任何有意义的结果集。为了从此类比较中获得有意义的结果,我们可以使用“is null”和“is not null”。
示例 mysql> select 10 is null;+------------+| 10 is null |+------------+| 0 |+------------+1 row in set (0.00 sec)mysql> select 10 is not null;+----------------+| 10 is not null |+----------------+| 1 |+----------------+1 row in set (0.00 sec)
上面的 mysql 语句显示了“is null”和“is not null”的使用。我们得到的结果是布尔值 0(对于 false)或 1(对于 true),这当然是一个有意义的结果。
以上就是mysql“is null”和“is not null”有什么好处?的详细内容。
其它类似信息

推荐信息