I have a problem with this query, I do not know what's wrong:
DELETE FROM mdl_forum_discussions WHERE id IN
(
SELECT mdl_forum_discussions.id
FROM mdl_forum_discussions
LEFT JOIN mdl_forum_posts ON mdl_forum_discussions.id = mdl_forum_posts.discussion
WHERE mdl_forum_discussions.id = 4
);
Return this error:
# 1093 - You can not specify target table 'mdl_forum_discussions' for update in FROM clause