我正在使用 MySQL 5.0+,如果表不存在,我正在尝试执行大量命令。所以我想拥有:
if not exist table
then
10000 line query that creates and populates the table with a lot of entries.
end if
唯一的问题是我一直在搜索,到目前为止我发现 MySQL 不支持这样的功能。
目前我有:
IF NOT EXISTS `profiles`
THEN
A LOT OF QUERIES;
END IF;
出于某种原因,它不断给我错误,说第 1 行的语法错误。
所以我想知道是否有人会碰巧对如何解决这个问题或如何解决这个问题有更好的想法。