Single Post - Most Comments

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS

Q&A for administrators, end users, developers and designers for Craft CMS

--How many posts have the exact same number of answers?
--select id, posttypeid, acceptedanswerid, parentid, score, answercount
--from posts
--where --answercount = 23
--id = 16476924

--select id, postid, score
--from comments
--where postid = 16476924

SELECT posts.title,count(posts.id) FROM posts
inner join comments on posts.id = comments.postid
group by posts.title
order by count(posts.id) desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results