Q&A for Joomla! administrators, users, developers and designers
SELECT count(Posts.Id) from posts left join posthistory on posts.id= posthistory.postid and posthistorytypeid=16 and posttypeid=2 and parentid in (SELECT postId from posthistory where posthistorytypeid=16)