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

Renegade

Well-known member
Can someone please spoon feed me with a query to find out node wise count of posts in the last 6 months?
 
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 Bottom