最近看到了陌生的mysql属性字段:
`hours` decimal(12,2) unsigned zerofill NOT NULL DEFAULT '0000000000.00'
unsigned zerofill ???
官方文档:https://dev.mysql.com/doc/refman/8.0/en/numeric-type-overview.html
UNSIGNED, if specified, disallows negative values.
即,该属性代表改列的值不允许为负数。
如果insert语句插入该列的值确实为负数,则库里存默认值。
If you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column.
Using ZEROFILL and a display width has no effect on how the data is stored. It affects only how it is displayed.
ZEROFILL仅仅改变展示宽度,对存储的数值没有任何影响。