无法在MySQL中插入临时表

时间:2017-10-20 20:32:02

标签: mysql sql node.js

我正在使用带有promise-mysql module的NodeJS v8.7.0,以及mysql v14.14 Distrib 5.5.57。

我无法插入我创建的临时表中。在在线SQL验证器以及我的项目中,我收到了关于INSERT命令的错误。

虽然我个人认为没有任何问题,但我希望看到一些新观点来发现问题。

我的整个查询字符串:

CREATE TEMPORARY TABLE QueryBuilder LIKE ItemStore;INSERT INTO QueryBuilder (AssetID, Owner, GameMode, GameID) VALUES (3426, -1, 1, 1), (3427, -1, 1, 1), (3428, -1, 1, 1);UPDATE ItemStore AS I JOIN QueryBuilder AS Q ON I.AssetID = Q.AssetID SET I.Owner = Q.Owner, I.GameMode = Q.GameMode, I.GameID = Q.GameID;DROP TEMPORARY TABLE QueryBuilder;

逐行查询:

CREATE TEMPORARY TABLE QueryBuilder LIKE ItemStore;
INSERT INTO QueryBuilder (AssetID, Owner, GameMode, GameID) VALUES (3426, -1, 1, 1), (3427, -1, 1, 1), (3428, -1, 1, 1);
UPDATE ItemStore AS I JOIN QueryBuilder AS Q ON I.AssetID = Q.AssetID SET I.Owner = Q.Owner, I.GameMode = Q.GameMode, I.GameID = Q.GameID;
DROP TEMPORARY TABLE QueryBuilder;

额外信息:

'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'INSERT INTO QueryBuilder (AssetID, Owner, GameMode, GameID) VALUES (3426, -1, 1,\' at line 1'
errno: 1064

An SQLFiddle demonstrating why I made this query

感谢您阅读我的问题,感谢所有反馈!

0 个答案:

没有答案