gpt4 book ai didi

mysql - INT(some value) - MYSQL 中的一些值的目的是什么?

转载 作者:行者123 更新时间:2023-11-29 04:27:20 26 4
gpt4 key购买 nike

我试过写 TINYINT(1)、TINYINT(2) 和 desc 表之后;语句 MYSQL 显示它们是不同的,但是当我尝试将值放入这些字段时,实际大小是相同的 - 从 -127 到 128 或者如果它是 UNSIGNED 到 256。那么使用这个的技巧是什么,我们可以只写 TINYINT 吗?提前致谢。

最佳答案

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

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.)

关于mysql - INT(some value) - MYSQL 中的一些值的目的是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8952531/

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