我有这个工作查询:
SELECT idVendRigMov
FROM VendRM
WHERE idArtPromo IS NULL AND
(idArtCategoria NOT IN (SELECT idArtCategoria FROM VendScontiCatEscl WHERE idVendSconti=2) OR idArtCategoria IS NULL) AND idVendTesMov=1
返回“idVendRigMov”列表;
我需要对此结果的每一行进行更新,如下所示:
UPDATE VendRigMov SET Sconto='7' WHERE idVendRigMov IN (result of previous query);
我试过这个:
UPDATE VendRigMov SET Sconto='7' WHERE idVendRigMov IN
(
SELECT idVendRigMov FROM VendRM WHERE idArtPromo IS NULL AND (idArtCategoria NOT IN (SELECT idArtCategoria FROM VendScontiCatEscl WHERE idVendSconti=2) OR
idArtCategoria IS NULL) AND idVendTesMov=1
)
但我收到此错误:“表“VendRM”的定义阻止对表“VendRigMov”进行更新操作”
我该怎么做这个查询?