Select Statement Errors..??

  • Yes

  • nice... : )


    Kindest Regards,

    Vasc

  • Guess I should really classify that "yes", the product table and the c_funds table each have their own unique id that takes no NULLS.. The two id's FUNDID and ActualID do allow nulls

  • This statement will never return 1 because of the NULL in the comparison. 

    Select 1

    Where 'x' Not IN ('a', null, 'b')

    This will always print 'what happened'

    if 'x' NOT IN ('a', null, 'b')

     print 'not in'

    Else

     print 'what happened'

    If you compare NOT IN to null the answer is always false.

    if 'x' NOT IN ('a', null, 'b')

    expands to:

    if 'x' <> 'a' AND 'x' <> null AND 'x' <> 'b'

    The 'x' <> null is false so the entire expression is false.

  • Cuz IN is out?

    Not the 1st IN strangeness that I have seen, once deleted all rows in a table when the IN clause returned a NULL value! TGIH for backups...

    Andy

  • That'S why you should derived tables and inner joins instead of in() .

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply