Thursday, June 22, 2006

The empty string IS NULL

LENGTH('MGS''X')=LENGTH('MGS')+LENGTH('X')=3+1=4

but

LENGTH('MGS''')=LENGTH('MGS')+0=3+0=3 (which IS NOT NULL)
vs.
LENGTH('MGS')+LENGTH('')=3+NULL=NULL (all = are IS NULL)

Counter-intuitive or what?

0 Comments:

Post a Comment

<< Home