有些开发人员在创建数据表时,由于懒惰直接使用Mysql的默认推荐设置.(即允许字段使用NULL值).而这一陋习很容易在使用NULL的场景中得出不确定的查询结果以及引起数据库性能的下降。...如果使用者对NULL属性不熟悉,很容易统计出错误的结果.
1234567891011
When using distinct,group by,order by,all null values are...虽然select NULL=NULL的结果为false,但是在我们使用distinct,group by,order by时,NULL又被认为是相同值.
1 (root@localhost mysql3306....sock)[zlm]>select id,name from test_null order by name;
28 +----+------+
29 | id | name |
30 +----+-...结果并不符合我们的期望值.
null value will influence the behavior of the operations such as “distinct”,“group by”,“order