mysql tinyint(1)vs tinyint(2)vs tinyint(3)vs tinyint(4) [英] mysql tinyint(1) vs tinyint(2) vs tinyint(3) vs tinyint(4)

查看:470
本文介绍了mysql tinyint(1)vs tinyint(2)vs tinyint(3)vs tinyint(4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
MySql:Tinyint(2)vs tinyint(1)-有何区别?

Possible Duplicate:
MySql: Tinyint (2) vs tinyint(1) - Which difference?

两者之间有什么区别

  • TinyINT(1)
  • TinyINT(2)
  • TinyINT(3)
  • TinyINT(4)
  • TinyINT(1)
  • TinyINT(2)
  • TinyINT(3)
  • TinyINT(4)

推荐答案

TinyINT(M)的范围始终为-128 .. + 127有符号或0..255无符号. M是显示宽度.

TinyINT(M) always has a range from -128..+127 signed or 0..255 unsigned. M is the display width.

M表示整数类型的最大显示宽度.最大值 显示宽度为255.显示宽度与以下范围无关 类型可以包含的值,如第11.2节数字"中所述 类型".对于浮点和定点类型,M为总数 可存储的位数.

M indicates the maximum display width for integer types. The maximum display width is 255. Display width is unrelated to the range of values a type can contain, as described in Section 11.2, "Numeric Types". For floating-point and fixed-point types, M is the total number of digits that can be stored.

来自 http://dev.mysql.com /doc/refman/5.5/en/numeric-type-overview.html

这篇关于mysql tinyint(1)vs tinyint(2)vs tinyint(3)vs tinyint(4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆