DELETE FROM images WHERE image_id IN(
(SELECT i.image_id FROM images i
LEFT JOIN ads a ON i.ad_id=a.id
WHERE ISNULL(a.id))
)
我需要完成此查询。任何帮助将不胜感激。谢谢;)
答案 0 :(得分:1)
DELETE i
FROM images i
LEFT JOIN ads a ON i.ad_id=a.id
WHERE ISNULL(a.id)