首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

MySql 数据类型 smallint 如何显示为 smallint(6)

2013-04-22 
MySql 数据类型 smallint 怎么显示为 smallint(6)mysql create table sales_quantity (- employee char(

MySql 数据类型 smallint 怎么显示为 smallint(6)
mysql> create table sales_quantity (
    -> employee char(6) references employee,
    -> product char(6) references products,
    -> quantity smallint );
Query OK, 0 rows affected (0.00 sec)

mysql> show tables;
+-----------------+
| Tables_in_sales |
+-----------------+
| employee        |
| products        |
| sales_quantity  |
+-----------------+
3 rows in set (0.00 sec)

mysql> desc sales_quantity;
+----------+-------------+------+-----+---------+-------+
| Field    | Type        | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| employee | char(6)     | YES  |     | NULL    |       |
| product  | char(6)     | YES  |     | NULL    |       |
| quantity | smallint(6) | YES  |     | NULL    |       |
+----------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql>

如上的步骤啊, 怎么指定数据类型明明是 smallint, 结果显示却为 smallint(6)???

有什么影响吗?

MySQL
[解决办法]
没什么影响,那个6是指定显示的宽度,不影响你使用的
别管它就好了

热点排行