如何修改mysql表中字段类型 如何修改mysql表中字段类型,我有一个字段是double(32,2)类型,我现在想把他修改成int类型,语句如何写啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 alter table 表名 change 字段 字段 int not null; mysql> desc tx;+-------+---------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+-------+---------+------+-----+---------+-------+| id | int(11) | YES | | NULL | || col1 | double | YES | | NULL | |+-------+---------+------+-----+---------+-------+2 rows in set (0.06 sec)mysql> alter table tx modify col1 int;Query OK, 0 rows affected (0.13 sec)Records: 0 Duplicates: 0 Warnings: 0mysql> desc tx;+-------+---------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+-------+---------+------+-----+---------+-------+| id | int(11) | YES | | NULL | || col1 | int(11) | YES | | NULL | |+-------+---------+------+-----+---------+-------+2 rows in set (0.00 sec)mysql> alter table tx modify column col1 int; [提问]建了一个数据库,插入项目的时候出了问题。大牛们帮忙看看。 MySql允许外部连接 PostgreSQL 存储过程的问题? 表中很多字段,如何检索不包含某列 新手上路,请大虾推荐几本经典的书!! 这是Mysql的BUG吗--彬、斌--如何分别查询 mysql+pureftp的问题 我做错了什么?我的phpmyadmin总说”数据库中没有数据表“ 左面明明有表 求助,重启Linux之后远程访问MySQL失败 mysql update 语句 如何取得前一次MySql操作所影响的行数? 关于按字母检索有人知道么?
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| col1 | double | YES | | NULL | |
+-------+---------+------+-----+---------+-------+
2 rows in set (0.06 sec)mysql> alter table tx modify col1 int;
Query OK, 0 rows affected (0.13 sec)
Records: 0 Duplicates: 0 Warnings: 0mysql> desc tx;
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| col1 | int(11) | YES | | NULL | |
+-------+---------+------+-----+---------+-------+
2 rows in set (0.00 sec)mysql>