mysql 特殊符号

1、完全等于 <=>

mysql> select  null <=> null;
+---------------+
| null <=> null |
+---------------+
|             1 |
+---------------+
1 row in set

mysql> select  null <=> 18;
+-------------+
| null <=> 18 |
+-------------+
|           0 |
+-------------+
1 row in set

mysql> 

注:用于严格比较两个null值是否相等,两个操作码均为null时,其所得值为1;而当一个操作码为null时,其所得值为0。mysql 数据库系统中,1代表true,0代表false。

2、不等于 <>

mysql> select  15 <> 18;
+----------+
| 15 <> 18 |
+----------+
|        1 |
+----------+
1 row in set

mysql> 

注:<> 同 !=

猜你喜欢

转载自www.cnblogs.com/Small-sunshine/p/10956502.html