1. Rename to table name
1) single
alter table table_name rename to new_table_name ;
2) multiple
rename table table_name1 to new_table_name1,
table_name2 rename to new_table_name2 ;
If there exist comment related to table, it must be included to it when alter command execute.
2. Rename to column name
Currently, there is no exist for rename command of column so you use the change command.
alter table table_name change column old_column new_column varchar(10).
If there exist comment and default value etc related to column, it must be included.
'RDB > MySQL' 카테고리의 다른 글
MySQL spool output (0) | 2020.07.08 |
---|---|
Mariadb event scheduler (0) | 2020.07.06 |
aws rds replication 설정 변경 (0) | 2020.06.17 |
mysql select 시 내부 소스코드 call flow (0) | 2020.06.16 |
mysql cmd 트랜잭션 (0) | 2020.06.16 |