这是一条mysql语句,能否请您说出问题所在

insert into wip_inventory
(wip_inventory.amount)
values (
  select
  sum(planning.actual_cost) as c
  from planning
  where planning.progress='no'
)

最佳答案

您需要两组括号才能使用values表示此逻辑(一组用于values列表,一组用于子查询)。但是,该关键字还是多余的:

insert into wip_inventory (wip_inventory.amount)
    select sum(planning.actual_cost) as c
    from planning
    where planning.progress = 'no';

10-06 08:38