Insert into a (a1,a2,a3) values (1,select num from b where id=1,3) 这样select语句出现在赋值语句中是不允许的。
可以这样:
insert into a (a1,a2,a3) select 1,num,3 from b where id=1 即可解决
Insert into a (a1,a2,a3) values (1,select num from b where id=1,3) 这样select语句出现在赋值语句中是不允许的。
可以这样:
insert into a (a1,a2,a3) select 1,num,3 from b where id=1 即可解决