Alter table if exists or create if doesn't

后端 未结 2 1056
春和景丽
春和景丽 2020-12-10 01:08

I need to run an installer which can also be an updater. The installer needs to be able to end up having a certain scheme/structure of the mysql database, regardless if some

2条回答
  •  春和景丽
    2020-12-10 01:56

    Well if you are using a coding language do:

    SHOW TABLES LIKE 'myTable'
    

    if it return a value call the alter else call the create

提交回复
热议问题