XF 1.4 Help with query to find out number of posts per node

Jake Bunce

XenForo moderator
Staff member
#2
Code:
SELECT n.node_id, n.title, COUNT(*) AS TotalPosts
FROM xf_node AS n
LEFT JOIN xf_thread AS t ON (t.node_id = n.node_id)
LEFT JOIN xf_post AS p ON (p.thread_id = t.thread_id)
WHERE p.post_date > UNIX_TIMESTAMP(DATE_SUB(now(), INTERVAL 6 MONTH))
GROUP BY n.node_id, n.title
 
Top