mysql special symbols

1, exactly equal to <=>

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

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

mysql> 

Note: for a strict comparison two null values ​​are equal, the operation code when the two are null, which is the resultant value of 1; and when the operation code is a null, which is the resultant value is 0. mysql database system, represents true, 0 representatives false.

2, not equal <>

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

mysql> 

Note: <> = same!

Guess you like

Origin www.cnblogs.com/Small-sunshine/p/10956502.html