要新建个中间表, 如下:
DELETE
FROM
user_notice
WHERE
id IN (select id from (
SELECT
un.id
FROM
`user_notice` un
LEFT JOIN user_notice_relation ur ON un.id = ur.id
WHERE
ur.id IS NULL
) as x);
网友评论