List:General Discussion« Previous MessageNext Message »
From:Jim Knepley Date:December 16 2003 10:22pm
Subject:Null-safe equal help, please
View as plain text  
I've got a WHERE clause:
WHERE possibly_null_value IS NULL
 
That works fine. This null-safe equal doesn't do what I expect:
WHERE possibly_null_value <=> NULL
 
The manual, and my testing, shows that NULL <=> NULL evaluates to 1, so
my now-fevered mind sees no reason the two above statements are not
equivalent.
 
What I _really_ want to do is this:
WHERE  possibly_null_value <=> INET_ATON(<IP>)
 
...so that if no IP is specificied it'll return those
possibly_null_value columns that are, in fact, NULL.
(Just as a test I've also tried possibly_null_value <=> NULLIF(
ISNULL(INET_ATON(<IP>)), 1 ), which is wrong for my app, but still
broken)
 
MySQL 4.0.15-standard
 
Any insight would be much appreciated.

Thread
Null-safe equal help, pleaseJim Knepley16 Dec
Re: Null-safe equal help, pleasePaul DuBois17 Dec
RE: Null-safe equal help, pleasePaul DuBois17 Dec
RE: Null-safe equal help, pleaseJim Knepley17 Dec
RE: Null-safe equal help, pleaseJim Knepley19 Dec