SQL: Using NULL values vs. default values

前端 未结 13 2232
南旧
南旧 2020-12-01 01:28

What are the pros and cons of using NULL values in SQL as opposed to default values?

13条回答
  •  粉色の甜心
    2020-12-01 01:49

    As one responder already said, NULL is not a value.

    Be very ware of anything proclaimed by anyone who speaks of "the NULL value" as if it were a value.

    NULL is not equal to itself. x=y yields false if both x and y are NULL. x=y yields true if both x and y are the default value.

    There are almost endless consequences to this seemingly very simple difference. And most of those consequences are booby traps that bite you real bad.

提交回复
热议问题