zoukankan      html  css  js  c++  java
  • 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的含义也是这样。


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

    赞赏支持

  • 相关阅读:
    Angular InjectionToken
    ionic 使用入门
    EFcore 横向分表
    .Netcore 默认认证授权
    anut 设计资源
    Aunt entity
    百度人脸真人认证
    Angular 省市区级联
    apache安装
    ppb|ppm
  • 原文地址:https://www.cnblogs.com/east7/p/15489872.html
Copyright © 2011-2022 走看看