Forums

Arrgh. Too tired to work this one out. (3 posts)

  1. barrybell
    Member
    Posted 2 years ago #

    Does anyone have a quick SQL statement that selects all users who have greater than 'x' number of published posts??

    Thanks in advance...

    B

  2. Otto42
    Moderator
    Posted 2 years ago #

    I think this would do it:

    select wp_users.*, count(*) from wp_users join wp_posts on post_author = wp_users.ID group by wp_users.ID having count(*) > X;

  3. barrybell
    Member
    Posted 2 years ago #

    Worked a treat - I owe you one!!

    B

Topic Closed

This topic has been closed to new replies.

About this Topic