Using Null

From Hashmysql
Jump to: navigation, search

Page still under development.


From Xgc:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.23-rc-community-log MySQL Community Server (GPL)
 
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
 
mysql> SELECT CASE WHEN NULL IS NULL THEN 1 ELSE 0 END;
+------------------------------------------+
| CASE WHEN NULL IS NULL THEN 1 ELSE 0 END |
+------------------------------------------+
|                                        1 |
+------------------------------------------+
1 row in set (0.02 sec)
 
mysql> SELECT CASE WHEN NULL IS NOT NULL THEN 1 ELSE 0 END;
+----------------------------------------------+
| CASE WHEN NULL IS NOT NULL THEN 1 ELSE 0 END |
+----------------------------------------------+
|                                            0 |
+----------------------------------------------+
1 row in set (0.02 sec)
 
mysql> SELECT CASE WHEN NULL IS NOT UNKNOWN THEN 1 ELSE 0 END;
+-------------------------------------------------+
| CASE WHEN NULL IS NOT UNKNOWN THEN 1 ELSE 0 END |
+-------------------------------------------------+
|                                               0 |
+-------------------------------------------------+
1 row in set (0.02 sec)
 
mysql> SELECT CASE WHEN NULL IS UNKNOWN THEN 1 ELSE 0 END;
+---------------------------------------------+
| CASE WHEN NULL IS UNKNOWN THEN 1 ELSE 0 END |
+---------------------------------------------+
|                                           1 |
+---------------------------------------------+
1 row in set (0.02 sec)
 
mysql> SELECT CASE WHEN NULL = NULL THEN 1 ELSE 0 END;
+-----------------------------------------+
| CASE WHEN NULL = NULL THEN 1 ELSE 0 END |
+-----------------------------------------+
|                                       0 |
+-----------------------------------------+
1 row in set (0.02 sec)
 
mysql> SELECT CASE WHEN NULL <> NULL THEN 1 ELSE 0 END;
+------------------------------------------+
| CASE WHEN NULL <> NULL THEN 1 ELSE 0 END |
+------------------------------------------+
|                                        0 |
+------------------------------------------+
1 row in set (0.02 sec)
 
mysql> SELECT CASE WHEN NULL <=> NULL THEN 1 ELSE 0 END;
+-------------------------------------------+
| CASE WHEN NULL <=> NULL THEN 1 ELSE 0 END |
+-------------------------------------------+
|                                         1 |
+-------------------------------------------+
1 row in set (0.02 sec)
 
mysql>