主键是什么? 如果主键是name,那么建议不要换 用select id,name,age from test一样的结果另外换字段顺序建议可以用复制表,然后drop原来的表,再复制回来create table temp as select id,name,age from test; drop table test; create table test as select id,name,age from test; drop table temp;注:上面建表语句是oracle中的,不知道mysql适合否,楼主可以试试
如果主键是name,那么建议不要换
用select id,name,age from test一样的结果另外换字段顺序建议可以用复制表,然后drop原来的表,再复制回来create table temp as select id,name,age from test;
drop table test;
create table test as select id,name,age from test;
drop table temp;注:上面建表语句是oracle中的,不知道mysql适合否,楼主可以试试