ORACLE SQL缺少右括号错误语法

时间:2016-03-18 10:46:22

标签: sql oracle oracle-sqldeveloper

我似乎无法弄清楚语法错误在哪里。即使查询非常简单。

提前致谢!

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 = ' ');

1 个答案:

答案 0 :(得分:2)

问题是两个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 = ' ' );