Insert default value when parameter is null

后端 未结 16 2389
遥遥无期
遥遥无期 2020-12-24 05:27

I have a table that has a column with a default value:

create table t (
    value varchar(50) default (\'something\')
)

I\'m using a stored

16条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-24 05:58

    The questioner needs to learn the difference between an empty value provided and null.

    Others have posted the right basic answer: A provided value, including a null, is something and therefore it's used. Default ONLY provides a value when none is provided. But the real problem here is lack of understanding of the value of null.

    .

提交回复
热议问题