When to use NULL in MySQL tables

后端 未结 11 1817
春和景丽
春和景丽 2020-11-29 22:59

I appreciate the semantic meaning of a NULL value in a database table, different from both false and the empty string \'\'. However, I have often read about performance pro

11条回答
  •  有刺的猬
    2020-11-29 23:33

    The empty string should not be used in place of NULL. NULL represents nothing where as the empty string is something, with nothing inside. NULL will always be false when compared to another value (even NULL) and NULL will not be summed in the COUNT function.

    If you need to represent unknown information there is no substitute to NULL.

提交回复
热议问题