ORACLE SQL 缺少右括号语法错误

ORACLE SQL missing right parenthesis bad syntax

我似乎无法弄清楚语法错误在哪里。尽管查询很简单。

提前致谢!

UPDATE t_stock
set f_atcid = (select a.id from t_atc a where a.f_code = ' ' where rownum < 2)
where id in (select f_stockid from t_barcode where f_barcode = ' ');

问题是两个 where 子句。将第二个更改为 and:

UPDATE t_stock
    set f_atcid = (select a.id
                   from t_atc a
                   where a.f_code = ' ' and
----------------------------------------^
                         rownum < 2
                  )
where id in (select f_stockid from t_barcode where f_barcode = ' ' );