这个SQL查询有什么问题?

Bri*_*cks 0 sql

我似乎在这个INSERT查询的某个地方出错了.谁能告诉我如何使这项工作?

谢谢.

INSERT INTO tablename ('score', 'coins-earned', 'bonus-used', 'topmultiplier', 'highscore', 'currentposition', 'super', 'star', 'color') 
VALUES ('1', '2', 'TRUE', '3', 'TRUE', '4', '5', '6', '7') 
Run Code Online (Sandbox Code Playgroud)

egr*_*nin 7

您将列名称放在引号中,并且列名称中的连字符可能无效.在MS SQL中,这是有效的:

INSERT INTO tablename (score, [coins-earned], [bonus-used], 
    topmultiplier, highscore, currentposition, super, star, color) 
VALUES ('1', '2', 'TRUE', '3', 'TRUE', '4', '5', '6', '7') 
Run Code Online (Sandbox Code Playgroud)

这也假设所有列都是char或varchar,它们可能不是.数字和布尔列也不需要引号,所以你可能会得到这样的结果:

INSERT INTO tablename (score, [coins-earned], [bonus-used], 
    topmultiplier, highscore, currentposition, super, star, color) 
VALUES (1, 2, TRUE, 3, TRUE, 4, '5', '6', '7') 
Run Code Online (Sandbox Code Playgroud)