Mysql: RENAME TABLE IF EXISTS

后端 未结 8 1280
甜味超标
甜味超标 2020-12-10 01:08

This DROP TABLE IF EXISTS works, too bad that RENAME TABLE IF EXISTS doesn\'t work.

Can anyone suggest a solution for this query?



        
8条回答
  •  星月不相逢
    2020-12-10 02:07

    create table table2 like table1;
    insert into table2 select * from table1;
    drop table table1;
    

提交回复
热议问题