SQLite3 simple select query

Discussion in 'Databases' started by linkinpark2014, Aug 13, 2009.

  1. #1
    hi all
    i have this SQLite3 query
    SELECT Count(*) FROM forums WHERE post_delay!=IS NULL
    PHP:
    it should not count rows with post_delay if it was empty...
    i have no idea what to do to make this work..
    i tried only NULL, but someone told me that using only NULL means false...its not empty record..

    any ideas?
     
    linkinpark2014, Aug 13, 2009 IP
  2. linkinpark2014

    linkinpark2014 Peon

    Messages:
    153
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    just solved it.....
     
    linkinpark2014, Aug 13, 2009 IP
  3. rayqsl

    rayqsl Active Member

    Messages:
    91
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    53
    #3
    NULL doesn't mean false. It means the column doesn't contain any data. A big difference.
     
    rayqsl, Aug 13, 2009 IP
  4. kblessinggr

    kblessinggr Peon

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Besides (this is from a MySQL background though), you can't do != IS NULL or even = IS NULL , since "IS NULL" is the condition itself

    For example to do what you were trying to do:

    post_delay IS NOT NULL

    that would be the whole condition, but a blank or space saved in a field still counts as content.
     
    kblessinggr, Aug 16, 2009 IP