• TINYINT[M]、INT[M]和BIGINT[M]中M值的意义


    TINYINT[(M)] [UNSIGNED] [ZEROFILL]

    A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255.

    INT[(M)] [UNSIGNED] [ZEROFILL]

    A normal-size integer. The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295.

    The 'M' is the maximum display width. However, this does NOT limit the range of values that can be stored in this column.

    由此可见,位数限制只影响读出来的数怎么展示。mysql 中int(M)和tinyint(M)中的M 表示最大显示宽度,并不表示存储长度,只有字段指定zerofill时有意义。如int(3),若实际值是2且列指定了zerofill,查询结果就是002,左边用0来填充。 int(3)、int(4)、int(8) 在磁盘上都是占用 4 btyes 的存储空间。bigint[M]中M的含义也是这样。


      读后有收获,小礼物走一走,请作者喝咖啡。

    赞赏支持

  • 相关阅读:
    动态创建DeepZoom
    MultiSheet Excel Output
    PL/SQL Developer设置技巧
    采购审批专题总结bob
    oracle dbms包和其他包的使用大全
    ARAuto Invoice question
    应收发票相关 脚本
    发运确认停靠站错误
    让R12直接从Form登录
    查找事物处理来源
  • 原文地址:https://www.cnblogs.com/east7/p/15489872.html
Copyright © 2020-2023  润新知