如何从表A中删除表B中不存在的记录?
我尝试过:
DELETE FROM
x
LEFT JOIN
y
ON
x.image_hash IS NOT NULL IN y
答案 0 :(得分:0)
适当使用EXISTS
或NOT EXISTS
子句。
DELETE FROM x WHERE <NOT> EXISTS (SELECT 1 FROM y WHERE y.<something> = x.<some_column> AND <some more conditions>