DELETE FROM AAA USING BBB WHERE (AAA.date = BBB.date)
AND (AAA.idtipo = BBB.idtipo)
AND (AAA.tariffario = BBB.tariffario)
AND (BBB.IDOrigine = 20 )
谢谢!! 吉安
答案 0 :(得分:1)
使用exists
:
DELETE FROM AAA
WHERE EXISTS (SELECT 1
FROM BBB
WHERE (AAA.date = BBB.date) AND
(AAA.idtipo = BBB.idtipo) AND
(AAA.tariffario = BBB.tariffario) AND
(BBB.IDOrigine = 20 )
);
这是标准的SQL,应该同时适用于Postgres和Oracle(以及其他数据库)。