From: "Harald Fuchs" <hf0722x@stripped>
> Yes, of course. "NULL <> 'blah'" returns NULL, and that's perfectly
> standards-conformant.
Furthermore, it's quite logical.
NULL is meant to indicate that the value is unknown. If a value is unknown
it can be anything.
So, in the example `col` <> 'blah', col can be anything, including 'blah'.
If you take that into consideration the only outcome of `col` <> 'blah' if
`col` = NULL *must* be NULL!
Fortunately there is function COALESCE() that will return the first argument
that is not NULL. In case of NULL values you can use a default value for an
expression: COALESCE( `col`*2, 14) will produce 14 if `col` is NULL.
Regards, Jigal.
| Thread |
|---|
| • bug or feature, <> 'blah' does NOT work with null records | matt_lists | 25 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Keith Ivey | 25 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | SGreen | 25 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Paul DuBois | 25 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Harald Fuchs | 28 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Jigal van Hemert | 28 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | (Pete Harlan) | 29 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Harald Fuchs | 28 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Jigal van Hemert | 28 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Martijn Tonies | 30 Oct |
| • RE: bug or feature, <> 'blah' does NOT work with null records | Jay Blanchard | 25 Oct |