SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    865
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Query is leaving out rows

    I have a simple webpage that uses the following query to show me how many emails are in the notifications table waiting to be sent. Most of the time it works great. But when there are some emails that have type = 'Group Email' no rows are returned even though I know for a fact that there is tons of emails waiting to go out.

    Any ideas?

    Thanks!


    PHP Code:
    select prioritytypecount(*) as total from notifications where sent is null group by type order by priority 
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,332
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    that query is fine

    if it's not showing you any results for a specific type, then there are only two possibilities -- there are no rows in the table for that specific type, or there are some rows in the table for that specific type, but none of them have a null sent column
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •