MENU
RENAME TABLE
RENAME TABLE tbl_name TO new_tbl_name [, tbl_name2 TO new_tbl_name2] ... |
The RENAME operation is performed atomically. No other session can access the table while it is being renamed. |
Renaming operations occur from left to right. To swap two table names, you can use: RENAME TABLE old_table TO tmp_table, new_table TO old_table, tmp_table TO new_table; |
You can RENAME TABLE to move a table from one database to another: RENAME TABLE this_db.tbl_name TO that_db.tbl_name; |
You cannot RENAME a TEMPORARY table. |