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的含义也是这样。


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

    赞赏支持

  • 相关阅读:
    Firefox地址栏样式设定
    定制Eclipse
    超简单的java爬虫
    JavaWeb--中文乱码小结
    编译原理之正则表达式转NFA
    Fedora下Eclipse/MyEclipse崩溃的解决方案
    利用Octopress在github pages上搭建个人博客
    在Eclipse中导入新浪微博SDK
    BlueMix
    云计算的三层简单理解
  • 原文地址:https://www.cnblogs.com/east7/p/15489872.html
Copyright © 2011-2022 走看看