SQL Query: Count How Many 2nd Post Replies in past 30 Days

ProCom

Well-known member
Our members are working towards having zero unanswered threads.

I was thinking it would be cool to run a query on the backend (via phpmyadmin) and see which members are most responsive with being the 2nd person to reply to threads.

Any SQL Masters out there able to put together a query to display the top 20 members that posted the 2nd reply to a thread in the past 30 days?

Thanks!!!
 
Some great members at TAZ solved this for me!

SELECT username, count(*)
FROM xf_post
WHERE position = 1 AND message_state = 'visible' AND post_date > UNIX_TIMESTAMP(DATE_ADD(NOW(), INTERVAL -30 DAY))
GROUP BY username
ORDER BY 2 DESC
LIMIT 50
 
Top Bottom