SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Utah, USA
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help needed with summary query.

    Hi guys,

    I'm looking for the number of users who have signed up for notifications at different intervals, e.g. how many have signed up to be notified immediately, once an hour, once a day ....

    My notifications table has a user id (uid) column and a send_interval column.

    mysql> select distinct send_interval from notifications;
    +---------------+
    | send_interval |
    +---------------+
    | 86400 |
    | 3600 |
    | 0 |
    | 43200 |
    | 604800 |
    +---------------+
    5 rows in set (0.19 sec)

    Any help you could offer would be greatly appreciated.

    Kevin

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,039
    Mentioned
    152 Post(s)
    Tagged
    2 Thread(s)
    Code SQL:
    SELECT
       send_interval 
     , COUNT(uid)
    FROM
       notifications
    GROUP BY
       time_interval

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Utah, USA
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Man you guys make this look easy!

  4. #4
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,039
    Mentioned
    152 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by kmillecam View Post
    Man you guys make this look easy!
    Thanks, I'll take that as a compliment


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •