[thelist] ASP & SQL
Paul Cowan
evolt at funkwit.com
Thu Sep 12 23:31:00 CDT 2002
Joshua Olson wrote:
> There's definitely a difference from having a problem with NULL's and
> acknowledging that some people will be overwhelmed when trying to
> incorporate them into the conditionals of a query. I agree, they are
> nice... but, they can complicate conditionals fairly quickly--adding even
> more wonderful OR's to the clause--unless you truly understand them.
What?
((fname = <varFName>) OR (COALESCE(<varFName>, '') = ''))
Hehe.
And yeah, you're both right. NULLs rule, but just try explaining boolean
logic using NULLs to people who don't get them. Most people get
true AND <null> is unknown
false OR <null> is unknown
etc...
and, eventually, grok that
1 = <null> is unknown, but
1 <> <null> is unknown
but then, when they think they've got it worked out, get very confused by
true OR <null> is true
false AND <null> is false
etc...
Use nulls wisely, my children.
Paul
More information about the thelist
mailing list