300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > int mysql是什么意思_MySQL数据类型 int什么意思

int mysql是什么意思_MySQL数据类型 int什么意思

时间:2022-02-06 23:43:53

相关推荐

int mysql是什么意思_MySQL数据类型 int什么意思

MySQL数据类型 int什么意思

关注:136答案:2mip版

解决时间 -01-30 21:51

提问者叫我女王

-01-30 10:52

MySQL数据类型 int什么意思

最佳答案

二级知识专家那年仲夏

-01-30 12:08

从 -2^31 (-2,147,483,648) 到 2^31 – 1 (2,147,483,647) 的整型数据(所有数字)。存储大小为 4 个字节。int 的 SQL-92 同义字为 integer。

全部回答

1楼错过の花开

-01-30 13:32

int(m) zerofill,加上zerofill后m才表现出有点点效果,比如 int(3) zerofill,你插入到数据库里的是10,则实际插入为010,也就是在前面补充加了一个0.如果int(3)和int(10)不加 zerofill,则它们没有什么区别.m不是用来限制int个数的.int(m)的最大值和最小值与undesigned有关,最下面那副图有说明.

mysql> create table t (t int(3) zerofill);

query ok, 0 rows affected (0.00 sec)

mysql> insert into t set t = 10;

query ok, 1 row affected (0.00 sec)

mysql> select * from t;

+——+

| t |

+——+

| 010 |

+——+

1 row in set (0.11 sec)

zerofill with default width, the same as int(10):

mysql> create table t (t int zerofill);

query ok, 0 rows affected (0.02 sec)

mysql> insert into t set t = 10;

query ok, 1 row affected (0.02 sec)

mysql> select * from t;

+————+

| t |

+————+

| 0000000010 |

+————+

1 row in set (0.08 sec)

without zerofill:

mysql> create table t (t int);

query ok, 0 rows affected (0.01 sec)

mysql> insert into t set t = 10;

query ok, 1 row affected (0.01 sec)

mysql> select * from t;

+——+

| t |

+——+

| 10 |

+——+

1 row in set (0.00 sec)

我要举报

如以上问答内容为低俗/色情/暴力/不良/侵权的信息,可以点下面链接进行举报,我们会做出相应处理,感谢你的支持!

→点此我要举报以上信息!←

推荐资讯

大家都在看

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。