Announcement

Collapse
No announcement yet.

SQL query to add email address to user list

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] SQL query to add email address to user list

    Hi,

    I have an SQL query that lets me see the number of posts by each member of a certain usergroup for a certain time period. I'm not an SQL person and patched this together from a bunch of google searches...and it works. It lists the number of posts and the user ID. Is there anyone that can help me get it to also list the user email address in the results? Here's my query:

    Code:
     SELECT COUNT(postid) AS count, vb_user.username
    FROM vb_post
    LEFT JOIN vb_user ON (vb_user.userid = vb_post.userid)
    WHERE (dateline > UNIX_TIMESTAMP('2015-06-31') AND dateline < UNIX_TIMESTAMP('2015-10-01'))
    AND vb_user.usergroupid IN (10,11)
    GROUP BY vb_post.username
    ORDER BY count
      DESC
    Thanks in advance.

    Kim

    Our forums: http://forums.opensuse.org, http://forums.microfocus.com, http://forums.netiq.com, and http://forums.suse.com

  • #2
    After vb_user.username add:
    Code:
    , vb_user.email
    For the record, the first character is a comma followed by a space.

    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment


    • #3
      Thank you Wayne. You're always really great to help when I have issues. Much appreciated.
      Our forums: http://forums.opensuse.org, http://forums.microfocus.com, http://forums.netiq.com, and http://forums.suse.com

      Comment

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