开发者

Mysql: DELETE with IN subquery

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜