msql 存储过程,各位大神帮忙找一下错误!!!!!在线等,急急急!!!

代码如下:
BEGIN
#Routine body goes here...
DECLARE n TINYINT DEFAULT 1;
DECLARE m TINYINT DEFAULT 1;
set n = 1000;
set m = 6763
while (n <= 2000) do
set n = n + 1;
WHILE (m <= 6901) DO
insert into trajectory_2017_06_10(appuser_id) values(n,select start_date from trajectory_2017_06_09 where id=m,
select end_date from trajectory_2017_06_09 where id=m,
select trajectory_gps from trajectory_2017_06_09 where id=m);
set m = m + 1;
END WHILE;
SET b = 1;

end while;

END!错误截图如下:(https://img-ask.csdn.net/upload/201706/14/1497426017_183953.png)

1个回答

insert into trajectory_2017_06_10(appuser_id) values(n,select start_date from trajectory_2017_06_09 where id=m,
select end_date from trajectory_2017_06_09 where id=m,
select trajectory_gps from trajectory_2017_06_09 where id=m); 这里你就设置了一个字段trajectory_2017_06_10(appuser_id),但你却设置了多个值

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问