在insert语句中需要插入查询出来的值。 Insert into a (a1,a2,a3) values (1,select num from b where id=1,3) 这样写就出现了“在此上下文中不允许使用子查询。只允许使用标量表达式。”这个错误

可以这样: insert into a (a1,a2,a3) select 1,num,3 from b where id=1 即可解决问题.

相关文章:

  • 2022-12-23
  • 2021-11-24
  • 2021-08-15
  • 2021-07-16
  • 2021-06-04
  • 2022-12-23
  • 2021-11-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-22
相关资源
相似解决方案