为什么数据类型定为某一种整型还要声名长度? 比如TINYINT是-128~127或0~255,那再声明数据的时候声明成 TINYINT(5)还有什么意义?如果说说明是5位,那么TINYINT (5)和INT(5)有什么区别? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 TINYINT (5)和tinyint得存储是一模一样的 如果列定义不加zerofill也是一样的加了zerofill不同之处在于客户端显示的时候 加长度得会自动补齐指定位的0mysql> create table test_1(a int)Query OK, 0 rows affected (1.22 smysql> insert into test_1 values(Query OK, 1 row affected (0.17 semysql> create table test_1(a int(ERROR 1050 (42S01): Table 'test_1mysql> create table test_2(a int(Query OK, 0 rows affected (0.20 smysql> insert into test_2 values(Query OK, 1 row affected (0.08 semysql> select * from test_1;+------+| a |+------+| 1 |+------+1 row in set (0.03 sec)mysql> select * from test_2;+-------+| a |+-------+| 00001 |+-------+1 row in set (0.06 sec)mysql> MYSQL数据插入时错误,请来看下 如何提高like效率 MYSQL管理问题 mysql新手问题 数据库修改记录问题,请高手帮忙 PostgreSQL 之间怎么实现同步? MySQL SERVER连出错 请问mySQL的mm.mysql.driver?? mysqlbinlog报错 mysql主从同步从库写入缓慢 MySQL 客户端EMS连接过来出现问题 一个MYSQL的子查询优化的问题
加了zerofill不同之处在于客户端显示的时候 加长度得会自动补齐指定位的0mysql> create table test_1(a int)
Query OK, 0 rows affected (1.22 smysql> insert into test_1 values(
Query OK, 1 row affected (0.17 semysql> create table test_1(a int(
ERROR 1050 (42S01): Table 'test_1
mysql> create table test_2(a int(
Query OK, 0 rows affected (0.20 smysql> insert into test_2 values(
Query OK, 1 row affected (0.08 semysql> select * from test_1;
+------+
| a |
+------+
| 1 |
+------+
1 row in set (0.03 sec)mysql> select * from test_2;
+-------+
| a |
+-------+
| 00001 |
+-------+
1 row in set (0.06 sec)mysql>