List:General Discussion« Previous MessageNext Message »
From:Michael T. Babcock Date:November 5 2002 6:09pm
Subject:Re: behaviour of WHERE statement with NULL fields
View as plain text  
Paul DuBois wrote:


>That makes perfect sense.  That value of NULL is unknown, so it's
>impossible to say whether or not it matches a pattern.  The only
>reasonable result is NULL.  Even NULL LIKE NULL and NULL REGEXP NULL
>return NULL, because you can't tell whether or not one unknown value
>is the same as another.
>  
>


Or, in other words, always include "IS NULL" if you expect NULL values 
to be returned in your >> QUERY << :) ; SELECT * FROM Users WHERE Password
LIKE "%password%" OR Password IS NULL;

-- 
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


Thread
behaviour of WHERE statement with NULL fieldsKevin McManus2 Nov
  • Re: behaviour of WHERE statement with NULL fieldsPaul DuBois2 Nov
  • Re: behaviour of WHERE statement with NULL fieldsDan Nelson2 Nov
Re: behaviour of WHERE statement with NULL fieldsMichael T. Babcock5 Nov