I run a self-hosted WordPress blog which has approx. 2000 topics. Many of them contain more than 200 comments.
I want to have a MySQL query which first search for posts which have more than a fixed number of comments such as 50 comments and then delete the extra old comments.
For example, the query searches for posts having more than 50 comments and then it deletes all old comments from those posts to make their comment count under 50.
I'll really appreciate if someone can provide such query statement.
Thanks in advance.