gpt4 book ai didi

MySQL INT 含义

转载 作者:IT王子 更新时间:2023-10-28 23:54:14 28 4
gpt4 key购买 nike

我想知道如果我采用值为 8 的 INT,这是否意味着我只能从 1 到 99999999 或从 1 到 4294967295 UNSIGNED?

最佳答案

文档似乎很清楚这一点:

Numeric Type Attributes

MySQL supports an extension for optionally specifying the display width of integer data types in parentheses following the base keyword for the type. For example, INT(4) specifies an INT with a display width of four digits. This optional display width may be used by applications to display integer values having a width less than the width specified for the column by left-padding them with spaces. (That is, this width is present in the metadata returned with result sets. Whether it is used or not is up to the application.)

The display width does not constrain the range of values that can be stored in the column. Nor does it prevent values wider than the column display width from being displayed correctly. For example, a column specified as SMALLINT(3) has the usual SMALLINT range of -32768 to 32767, and values outside the range permitted by three digits are displayed in full using more than three digits.

http://dev.mysql.com/doc/refman/5.5/en/numeric-types.html

关于MySQL INT 含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6817479/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com