mysql - Error: You can't specify target table 'wp_postmeta' for update in FROM clause -


delete   wp_postmeta   post_id in (     select id       wp_posts       post_type = 'attachment' , post_parent in (         select post_id         wp_postmeta         meta_value = 'mycbgenie'         )     )   

one option can try is:

delete `wp_postmeta` `post_id` in (   select `id`   `wp_posts`   `post_type` = 'attachment' , `post_parent` in (     select `der`.`post_id`     (select `post_id`           `wp_postmeta`           `meta_value` = 'mycbgenie') `der`   ) ); 

sql fiddle demo


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -