开发者

Mysql: DELETE with IN subquery

开发者 https://www.devze.com 2023-02-17 10:13 出处:网络
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))
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))
)
开发者_StackOverflow社区

I need to accomplish this query. Any help will be appreciated. Thanks ;)


DELETE i
    FROM images i
        LEFT JOIN ads a ON i.ad_id=a.id
    WHERE ISNULL(a.id)
0

精彩评论

暂无评论...
验证码 换一张
取 消