What's the difference in int(11) and int(11) UNSIGNED?

后端 未结 8 788
鱼传尺愫
鱼传尺愫 2020-12-13 08:30

What\'s the difference in int(11) and int(11) UNSIGNED ?

8条回答
  •  暖寄归人
    2020-12-13 09:04

    All integer types can have an optional (nonstandard) attribute UNSIGNED. Unsigned type can be used to permit only nonnegative numbers in a column or when you need a larger upper numeric range for the column. For example, if an INT column is UNSIGNED, the size of the column's range is the same but its endpoints shift from -2147483648 and 2147483647 up to 0 and 4294967295.

    see here: http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html

提交回复
热议问题