问:怎么修改Mysql中的表格的某列的列名?
答:比如说我想将seat表中的seatid列名修改为 seat_id;
1、初状态:
输入:select * from seat; 查看seat 表的 整体状态;
2、输入修改列名语句:
语句:alter table + seat + change column +seatid + seat_id + int;
格式:alter table 表名 change column 旧列名 新列名 新列名格式;
3、末状态:
输入:select*from seat;查看seat表格的状态;
大家可以看到,第一列的列名从seatid变为seat_id了;