重新排序列的简单方法?

2022-01-05 00:00:00 mysql phpmyadmin

我正在研究一个数据库.在大多数表上,列顺序不是我所期望的,我想更改它(我有权限).例如,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?

推荐答案

使用 ALTERTABLE ... MODIFY COLUMN 语句.

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

相关文章