您的位置:首页 > 数据库 > MySQL

mysql int 10 字段长度

2015-06-11 09:19 447 查看
The wrong understanding:

int 10 can store the number 1234567890, and  int 3 can only store the number 123.

It should be that:



Yes, in type int ,the max value of number has nothing with it's length  in mysql, it means int 10 is the same with int 3 in the max value of number. 

A little difference is :

when the cloumn is set zerofill, create table a(b int(3) zerofill);

the value 5, will be 050 if int 3, and will be 0000000050 if int 10.

Thank you.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: