1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'XenForo Questions and Support' started by Renegade, Nov 8, 2014.

  1. Renegade

    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?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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
    
     
    SnoSheriff and Renegade like this.

Share This Page