oracle update语法问题

需要update 数据成 满足条件的第一行

运行提示信息

 update mg.detail a set (id, promotion_price)= 
(
 select sub.id, sub.promotion_price from  
    (select b.id, b.shop_id, c.barcode, c.sale_scale, c.promotion_price,
     from mg.promotion b, mg.promotion_goods c 
     where c.id = b.id and b.status = 0 and b.start_time <= sysdate and b.finish_time >= sysdate 
     and b.shop_id = a.shop_id and c.barcode = a.barcode and c.sale_scale = a.sale_scale 
     order by b.id
    ) sub 
  where rownum=1
) 
where exists (select 1 from mg.promotion b, mg.promotion_goods c 
where c.id = b.id and b.status = 0 and b.start_time <= sysdate and b.finish_time >= sysdate 
and b.shop_id = a.shop_id and c.barcode = a.barcode and c.sale_scale = a.sale_scale)

img

确定表格字段没问题,感觉是ORACLE update 不支持该语法;删除sale_scale条件后 提示barcode字段,删除barcode条件后 提示shop_id字段

mg.detail表中有没有SALE_SCALE字段呢

你看看这个mg.detail表有没有sale_scale这个字段