如何修改mysql表中字段类型
如何修改mysql表中字段类型,我有一个字段是double(32,2)类型,我现在想把他修改成int类型,语句如何写啊
SQL code:
alter table 表名 change 字段 字段 int not null;
SQL code:
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: 0
mysql> 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;
相关问答:
如题,这三个在win7下使用会有什么兼容性问题吗?
由于我最近在使用win7,就懒得进xp了!
自己用windows 2008有一年多了,没出现任何问题。
win7测试版也用过,不会有什么问题的,放心。
当然你最 ......
我现在学习MYSQL,问下mysql储存过程如何建立和使用,最好写成$sql="sql语句",$re=mysql_query($sql);谢谢
建议你先自己看一下文档中的例子。
http://dev.mysql.com/doc/refman/5.1/zh/stored-pro ......
我以前安装了一次,后来卸载了,现在再安装的时候,提示错误:Error 1305.Error reading from file C:DOCUME~1\LOCALS~1\Temp\mysql_server.msi.Verify that the file exists and that you can access it.
可是我找 ......
我用的like模糊查询,比如mysql的name中有“csdn论坛系统”这几个字,如何在 <input>中查询“csdn 系统”也能出来这个“csdn论坛系统”,我现在是查“csdn”或者“系统”都可以。谢谢各位了!不知道我这么表达 ......
有一个表 mytable 有下面几个字段
id class(学生班级) studentSex(学生性别,1男2女) studentName(学生性名)
假设现有十几个班级,
我想获得班级中男学生最多的三条相应 ......