重新排序列的简便方法? [英] Easy way to re-order columns?

查看:78
本文介绍了重新排序列的简便方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理数据库.在大多数表上,列顺序不是我期望的,我想更改它(我有权限).例如,primary_key的id列很少是第一列!

I'm working on a database. On most of the tables, the column order is not what I would expect, and I would like to change it (I have the permission). For example, the primary_key's id columns are rarely the first column!

是否有使用phpMyAdmin移动列的简便方法?

Is there an easy method of moving columns with phpMyAdmin?

推荐答案

使用 ALTER TABLE ... MODIFY COLUMN 语句.

ALTER TABLE table_name MODIFY COLUMN misplaced_column INT(11) AFTER other_column;

这篇关于重新排序列的简便方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆