Search for useres with X amount of posts over a certain period of time?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nwingate
    Senior Member
    • Jul 2003
    • 561
    • 3.8.x

    Search for useres with X amount of posts over a certain period of time?

    I'm wanting to run a contest and to enter the members have to have 25 posts over a period of 1 week.

    How can I search for all the members who have 25 posts over one week?
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    This query will return a descending list of post counts with usernames over the last 7 days:

    Code:
    SELECT COUNT(post.postid) AS count, user.username
    FROM user AS user
    LEFT JOIN post AS post ON (post.userid = user.userid)
    WHERE post.dateline > UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 7 DAY))
    GROUP BY post.userid
    ORDER BY count
    DESC

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...