複製一個新的表格schema與舊表格相同
create table new_table_name like old_table_name
將舊表格資料存入新表格
insert into new_table_name select * from old_table_name
重新命名表格
rename table `old_table_name` to new_table_name
開啟一個暫存用的table(僅有此次連線可以連),某些情況下配合表格的複製挺好用
create temporary table tmp_name
create table new_table_name like old_table_name
將舊表格資料存入新表格
insert into new_table_name select * from old_table_name
重新命名表格
rename table `old_table_name` to new_table_name
開啟一個暫存用的table(僅有此次連線可以連),某些情況下配合表格的複製挺好用
create temporary table tmp_name