next up previous contents
Next: 實機操作練習題 Up: ALTER 語法 Previous: SET DEFAULT 設定預設值   Contents

RENAME 重新命令

  1. ALTER RENAME TO 變更資料表 dyw_tbl 名稱為 alter_tbl
    mysql> alter table dyw_tbl rename to alter_tbl;
    mysql> show tables;
    Tables_in_dyw
    alter_tbl
    dcount_tbl
    
  2. ALTER RENAME TO 再將資料表 alter_tbl 名稱變更回 dyw_tbl
    mysql> alter table alter_tbl rename to dyw_tbl;
    mysql> show tables;
    Tables_in_dyw
    dcount_tbl
    dyw_tbl
    



2018-06-19