null
'' is an empty character, which is equivalent to having an account in the bank, but no money.
null is empty, which is equivalent to not having an account in the bank.
To compare null, you need to use is null or is not Null judgment
When null encounters an operator, it will always return null. =null or!=null, etc. will all return null, and the efficiency is not high, so when creating a table, there will usually be not null default '';
mysql> select goods_name from goods where goods_name is not null limit 3; +--------------------+ | goods_name | +--------------------+ | KD876 | | htcN85原装充电器 | | 诺基亚原装5800耳机 | +--------------------+
3 rows in set (0.00 sec)
mysql> select goods_name from goods where goods_name is null ; Empty set (0.00 sec)
null will return null when encountering the operator
mysql> select goods_name from goods where goods_name=null ; Empty set (0.00 sec)
mysql> select goods_name from goods where goods_name!=null ; Empty set (0.00 sec)
The above is mysql null and ' ' content, please pay attention to the PHP Chinese website (www.php.cn) for more related content!