老问题新问(列顺序)
如何在指定位置插入字段,一般添加字段是在未尾!!!谢谢指点!!!!!!!!!!!!!!!!!!!!!!!!! 在加入新字段的语句之后追加 After关键字即可:
alter table tablename add column colname columntype after column; alter table news add column ID int(11) after column;
alter table news add column ID int(11) after 1;
alter table news add column ID int(11) after column 1;
好象都不成功
alter table news add column ID int(11) after columname; 成功
谢谢!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[ 本帖最后由 wang01 于 2007-10-30 12:16 编辑 ] 谢谢kider!!!!!!!!!!!!!!!!
在之前插入又有问题
alter table news add column ID int(11) first columname; 原帖由 wang01 于 2007-10-30 12:41 发表 http://www.mysqlpub.com/images/common/back.gifalter table news add column ID int(11) first columname;
正确用法是: alter table news add column ID int(11) first ;
含义是:增加的新列作为第一列,而不是在那列之前增加新列。 :victory: 理解的够深刻,牛...
页:
[1]