当我使用以下命令时:
insert into history (id, command)
values(2,'insert into show(id, moderator_ID, film_ID, time_length, adress, details) values(42,2,1,'123','123','123')');
它返回错误:缺少逗号。为什么呢?
答案 0 :(得分:1)
在第二次插入查询中使用双引号而非单引号
insert into history (id, command)
values (2,'insert into show
(id, moderator_ID, film_ID, time_length, adress, details)
values (42,2,1,\"123\",\"123\",\"123\")');
答案 1 :(得分:0)
使用这样的双引号:
INSERT INTO `history` ( `id` , `command` )
VALUES ( '2', 'insert into show(id, moderator_ID, film_ID, time_length, adress, details) values(42,2,1,''123'',''123'',''123'')');