• SQAPro (8/25/2009)


    Glad to see this get covered. I know this tripped me up early on in the process of learning SQL..

    A more experienced person (our DBA) explained it to me thusly

    "null is never equal to, less than, greater than, or to anything." "ANY attempt to compare NULL with anything else, will fail"

    in other words, pardon the pun but, 'null is beyond compare.'

    This was followed by "if you need to do such a comparison in a case where some of the 'values' may be null, then learn to use ISNULL"

    ISNULL is your friend!

    'Course that's dependent upon ANSI_NULLS 😛