When I execute the following query:
DELETE FROM wp_postmeta
WHERE post_id
NOT IN (
SELECT post_id
FROM wp_postmeta a
INNER JOIN wp_sl_posts b
ON a.post_id = b.id
)
I get an error message:
You can't specify target table 'wp_postmeta' for update in FROM clause
I sort of know why, but I really don't know the syntax required here to perform the operation. I've tried a few different alternatives based on answers here and elsewhere, but not luck.