Do I do a subquery?

There is a wordpress.
There are tables wp_posts and wp_postmeta

Do
select count(`pm`.`meta_id`) from `wp_postmeta` as `pm` where `pm`.`post_id` in(
 (SELECT `p`.`ID` FROM `wp_posts` as `p` where `p`.`post_content`=" limit 1) as x
)


The query runs very long, in the end gives error 504 timeout
What am I doing wrong? I even limit 1 set.

In the future I want to remove all records from wp_postmeta belonging to the posts, which content is empty.
July 9th 19 at 13:50
3 answers
July 9th 19 at 13:52
upd: Take as x and the extra brackets. should be in (the query).
nonsense say - jerod.Herm commented on July 9th 19 at 13:55
Yes, checked, it works with equal. Okay, post_content that is an empty string or null? - Ivory.Swift90 commented on July 9th 19 at 13:58
here it is. Take as x and the extra brackets. should be in (the query). - Ivory.Swift90 commented on July 9th 19 at 14:01
July 9th 19 at 13:54
in some versions of mysql limit is not supported in subqueries, try to remove
he set the limit later, so the problem is not in it - jerod.Herm commented on July 9th 19 at 13:57
July 9th 19 at 13:56
SELECT COUNT(*) 
 FROM `wp_postmeta` as `pm` 
 JOIN `wp_posts` AS `p` ON `p`.`ID` = `pm`.`post_id` AND `p`.`post_content` = "

Find more questions by tags MySQL