我似乎无法弄清楚语法错误在哪里。即使查询非常简单。
提前致谢!
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 = ' ');
答案 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 = ' ' );