看看下面这两段关于null的经典描述
The NULL value means "no data" and is different from values such as 0 for numeric types or the empty string for string types.
The concept of the NULL value is a common source of confusion for newcomers to SQL, who
often think that NULL is the same thing as an empty string ''. This is not the case! For
example, the following statements are completely dierent:
mysql> INSERT INTO my_table (phone) VALUES (NULL);
mysql> INSERT INTO my_table (phone) VALUES ("");
Both statements insert a value into the phone column, but the rst inserts a NULL value
and the second inserts an empty string. The meaning of the rst can be regarded as \phone
number is not known" and the meaning of the second can be regarded as \she has no
phone".
In SQL, the NULL value is always false in comparison to any other value, even NULL. An
expression that contains NULL always produces a NULL value unless otherwise indicated in
the documentation for the operators and functions involved in the expression. All columns
in the following example return NULL:
mysql> SELECT NULL,1+NULL,CONCAT('Invisible',NULL);
If you want to search for column values that are NULL, you cannot use the =NULL test. The
following statement returns no rows, because expr = NULL is FALSE, for any expression: