From: Johan De Meersman Date: March 9 2012 9:36pm Subject: Re: query problem with null List-Archive: http://lists.mysql.com/mysql/226954 Message-Id: <6b2bfd70-606e-4eb6-a7cc-95401ae02db2@zimbra> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit ----- Original Message ----- > From: "David Lerer" > > Have you tried to set city = null (i.e. without the quotes)? Spot on, I'd think. NULL values are not a string with "NULL" in it - that's only what it looks like in query results :-) An empty string ('') is to strings what 0 (zero) is for integers: it says "the value of this field is nothing". NULL, on the other hand, means "the value of this field is a total unknown", which is useful, for example, in a field 'quantity': zero is still a valid, meaningful quantity; whereas you would use NULL to indicate that you simply do not know the quantity. It's a bit of a peculiar concept, but as David indicated, IS NULL will not match fields set to the string "NULL" - as that is a string, not an unknown. Another funny attribute of NULL is that NULL != NULL. There simply *is* nothing to compare, so you cannot ever say it's equal. -- Bier met grenadyn Is als mosterd by den wyn Sy die't drinkt, is eene kwezel Hy die't drinkt, is ras een ezel