List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 5 2001 11:56pm
Subject:Re: Nulls appear not be respected
View as plain text  
At 3:45 PM -0500 6/5/01, Mark Stosberg wrote:
>Jeremy Zawodny wrote:
>>
>>  On Tue, Jun 05, 2001 at 02:18:15PM -0500, Mark Stosberg wrote:
>>  >
>>  > However, if I ask for the rows where last_visit = NULL, it says there are
>>  > not any! :
>>  > mysql> select user_id,screen_name,password,last_visit,
>>  > second_to_last_visit from users where  last_visit = NULL;
>>
>>  What if you use "last_visit IS NULL"?
>>
>>  (Hint: That's the correct syntax.)
>
>Thanks, this works. I still think MySQL behaved poorly by not either:
>a), accepting my syntax, or B.) throwing an error that the syntax was
>incorrect. The result it returned appeared incorrect.

The syntax isn't incorrect.  It's perfectly legal.  It simply didn't
reflect the semantics that you intended.

It's no more nonsense than WHERE 1 = 0.  That appears not to make
sense on the face of it, but it has its uses.

>
>   -mark
>
>http://mark.stosberg.com/



-- 
Paul DuBois, paul@stripped
Thread
Nulls appear not be respectedMark Stosberg5 Jun
  • Re: Nulls appear not be respectedVan5 Jun
  • Re: Nulls appear not be respectedJeremy Zawodny5 Jun
  • Re: Nulls appear not be respectedMark Stosberg5 Jun
    • Re: Nulls appear not be respectedTonu Samuel6 Jun
      • Re: Nulls appear not be respectedMark Stosberg6 Jun
    • Re: Nulls appear not be respectedPaul DuBois6 Jun
  • Re: Nulls appear not be respectedGerald Clark5 Jun
  • Re: Nulls appear not be respectedMark Stosberg5 Jun
    • Re: Nulls appear not be respectedBob Hall7 Jun
  • RE: Nulls appear not be respectedMichael Eklund5 Jun