HOME | 資料庫 | Mysql表格schema複製、資料複製、重新命名與暫存表格
複製一個新的表格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

發表評論

暱稱

網址

電郵

開啟HTML 開啟UBB 開啟表情 隱藏 記住我 [登入] [註冊]