我已经看过几个与此类似的问题,但似乎没有一个我正在寻找的问题。这些是我收到错误的值。
insert into Artist(artistId, artistName)
values(
(1,"Artist1"),
(2,"Artist2"),
(3,"Artist3"),
(4,"Artist4"),
(5,"Artist5"),
(6,"Artist6"),
(7,"Artist7"),
(8,"Artist8"),
(9,"Artist9"),
(10,"Artist10"));
我的代码中是否存在可能导致此错误的语法错误?
答案 0 :(得分:2)
删除括号:
insert into Artist(artistId, artistName)
values
(1,"Artist1"),
(2,"Artist2"),
(3,"Artist3"),
(4,"Artist4"),
(5,"Artist5"),
(6,"Artist6"),
(7,"Artist7"),
(8,"Artist8"),
(9,"Artist9"),
(10,"Artist10");
的 SqlFiddleDemo
强>
INSERT INTO tab(column_list)
VALUES (row_1_value_list), (row_2_value_list), ...;