MysqlNULL-创新互联

本篇文章给大家分享的是有关Mysql NULL,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

创新互联公司长期为上千多家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为景洪企业提供专业的网站设计、成都做网站,景洪网站改版等技术服务。拥有十余年丰富建站经验和众多成功案例,为您定制开发。

比较运算符中使用NULL

mysql> select 1>NULL;
+--------+
| 1>NULL |
+--------+
|  NULL |
+--------+
1 row in set (0.00 sec)

mysql> select 1 select 1<>NULL;
+---------+
| 1<>NULL |
+---------+
|  NULL |
+---------+
1 row in set (0.00 sec)

mysql> select 1>NULL;
+--------+
| 1>NULL |
+--------+
|  NULL |
+--------+
1 row in set (0.00 sec)

mysql> select 1 select 1>=NULL;
+---------+
| 1>=NULL |
+---------+
|  NULL |
+---------+
1 row in set (0.00 sec)

mysql> select 1<=NULL;
+---------+
| 1<=NULL |
+---------+
|  NULL |
+---------+
1 row in set (0.00 sec)

mysql> select 1!=NULL;
+---------+
| 1!=NULL |
+---------+
|  NULL |
+---------+
1 row in set (0.00 sec)

mysql> select 1<>NULL;
+---------+
| 1<>NULL |
+---------+
|  NULL |
+---------+
1 row in set (0.00 sec)

mysql> select NULL=NULL,NULL!=NULL;
+-----------+------------+
| NULL=NULL | NULL!=NULL |
+-----------+------------+
|   NULL |    NULL |
+-----------+------------+
1 row in set (0.00 sec)

mysql> select 1 in (null),1 not in (null),null in (null),null not in (null);
+-------------+-----------------+----------------+--------------------+
| 1 in (null) | 1 not in (null) | null in (null) | null not in (null) |
+-------------+-----------------+----------------+--------------------+
|    NULL |      NULL |      NULL |        NULL |
+-------------+-----------------+----------------+--------------------+
1 row in set (0.00 sec)

mysql> select 1=any(select null),null=any(select null);
+--------------------+-----------------------+
| 1=any(select null) | null=any(select null) |
+--------------------+-----------------------+
|        NULL |         NULL |
+--------------------+-----------------------+
1 row in set (0.00 sec)

mysql> select 1=all(select null),null=all(select null);
+--------------------+-----------------------+
| 1=all(select null) | null=all(select null) |
+--------------------+-----------------------+
|        NULL |         NULL |
+--------------------+-----------------------+
1 row in set (0.00 sec)

本文题目:MysqlNULL-创新互联
文章来源:http://ybzwz.com/article/ceoshs.html