嗨,我正在尝试在使用以下代码截断表格之前保留表格的备份。
IF EXISTS (`emails3`) THEN
SELECT * INTO `emails3`
FROM `emails1`;
SELECT * INTO `emails3`
FROM `emails2`
WHERE NOT `word` IN (SELECT `word`
FROM `emails1`) AND
`word` NOT IN (SELECT `word`
FROM `emails3`);
END IF;
IF NOT EXISTS (`emails3`) THEN
CREATE TABLE `emails3` SELECT * FROM `emails1`;
SELECT * INTO `emails3`
FROM `emails2`
WHERE NOT `word` IN (SELECT `word` FROM `emails1`);
END IF;
TRUNCATE `emails1`;
但我一直收到这个错误,因为我是一个 mysql 菜鸟,所以我看不出有什么问题,如果你能看到代码有什么问题,请帮忙。