首页 > 数据库技术 > 详细

MySQL添加和删除字段

时间:2015-05-06 19:37:03      阅读:179      评论:0      收藏:0      [点我收藏+]

查询表的字段类型:

 

mysql> desc t_template_title;
+----------------+--------------+------+-----+---------+-------+
| Field          | Type         | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+-------+
| id             | int(11)      | NO   |     | 0       |       |
| effective_time | int(11)      | NO   |     | 0       |       |
| props          | varchar(128) | NO   |     |         |       |
| props_passive  | varchar(128) | NO   |     |         |       |
| buffs          | varchar(128) | NO   |     |         |       |
| name           | varchar(64)  | NO   |     |         |       |
| resource_type  | int(11)      | NO   |     | 0       |       |
| resource_id    | int(11)      | NO   |     | 0       |       |
| pic_width      | int(11)      | NO   |     | 0       |       |
| pic_height     | int(11)      | NO   |     | 0       |       |
| descript       | varchar(256) | NO   |     |         |       |
| agent          | smallint(6)  | NO   |     | 0       |       |
| type           | tinyint(4)   | NO   |     | 0       |       |
| order          | int(4)       | NO   |     | 0       |       |
+----------------+--------------+------+-----+---------+-------+

  

 

添加字段:

alter table t_template_title add props_passive VARCHAR(128) NOT NULL default ‘‘ after props;

 

 

删除字段:

mysql> alter table t_template_title drop props_passive;

  

MySQL添加和删除字段

原文:http://www.cnblogs.com/jluzhsai/p/4482840.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!