NULL-safe equal : NULL safe equal : Comparison Functions Operators MySQL TUTORIALS


MySQL TUTORIALS » Comparison Functions Operators » NULL safe equal »

 

NULL-safe equal


NULL-safe equal() performs an equality comparison like the = operator.

NULL-safe equal() returns 1 rather than NULL if both operands are NULL.

NULL-safe equal() returns 0 rather than NULL if one operand is NULL.

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

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

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Comparison Functions Operators
» NULL safe equal