SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 27 of 27

Thread: Query to filter out certain people

  1. #26
    SQL Consultant silver trophybronze trophy
    SitePoint Award Recipient r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    38,458
    Mentioned
    34 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by busboy
    How would I modfiy your code so that it counts both "Attempt" and "Message" and as long as their combined total is less than six, then don't filter them out?
    Code:
    having sum(case when com.type in ( 'Message'
                                     , 'Attempt' )
                    then 1 else 0 end) < 6
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  2. #27
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    801
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much. This worked perfect.
    Convert your dollars into silver coins. www.convert2silver.com

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
  •