创建表
创建表时进行判断
CREATE TABLE IF NOT EXISTS
删除表中的 唯一索引
IF
语句只能用在存储过程中,见官方文档:
An IF … END IF block, like all other flow-control blocks used within stored programs, must be terminated with a semicolon, as shown in this example:
from 【IF Statement】
在执行新表创建,特别是批量创建时,一定要先对表的存在状态做判断,即使用if exists,不然一旦创建出错,后面的语句将无法执行。
MySQL if 语句用法
https://blog.youkuaiyun.com/wzzfeitian/article/details/55097563