When I execute this query:
DELETE FROM `wp_posts` WHERE id NOT IN
(SELECT id FROM wp_posts WHERE post_status = 'publish')
I get the following error message:
You can't specify target table 'wp_posts' for update in FROM clause
Not sure what the syntax issue is here.
DELETE. The way the queries are handled would cause undefined behaviour if it were allowed.