Hehe, this is almost identical to the post I submitted yesterday, entitled "SELECT 
'foobar' = 0"

There's a patch in that post, doesn't work for dates but should give an idea of what 
has to be done.

The reason is that 'WWW' has to be converted to a date. And the conversion gives it a 
value of 0. So you're comparing 0 and 0, which results in 'true'.

Anyway, that's why it happens :).

Adam Hooper
[EMAIL PROTECTED]

On Tue, 28 May 2002 11:07:08 -0600
"I. TS" <[EMAIL PROTECTED]> wrote:

> 
>  My SQL query problem:
> 
>  I met a strange problem:
> 
> 
>   For example, I have the following table:
> 
>   Mytable:
> 
>   No   Name          Date                   Project
>   1      Bob          2002-05-27        Bob's project
>   2      John         0000-00-00       John's project
> 
>   When I use "select * from Mytable WHERE Date = 'WWW';"
> 
>   it gives me the result:
>   2      John         0000-00-00       John's project
> 
>   I think it should not return any rows.
> 
>   Why?
> 
>   Thanks.
> 
>   I. TS
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to