List:General Discussion« Previous MessageNext Message »
From:Michael T. Babcock Date:November 11 2002 8:58pm
Subject:Re: Problems with simple(?) query
View as plain text  
Keith C. Ivey wrote:

>On 11 Nov 2002, at 20:03, James Dyer wrote:
>
>>SELECT * FROM foo WHERE id2=1 AND id2=2 (for example),
>>
>>I just get an empty set returned. An explain on the query gives an 'Impossible
> WHERE'
>>message.
>>    
>>
>
>Because it's impossible for id2 to be both 1 and 2.  What were you 
>expecting?  Did you mean "id1 = 1 AND id2 = 2"?  If not, you need to 
>explain what records you're trying to get.
>  
>

I've found that quite a few people I know misconstrue boolean values to 
mean the opposites of what they in fact do mean in queries as in "I want 
the record where ID is 1 and the record where it is 2" is not as written 
above, but in fact "WHERE ID2 IN (1, 2)" or "WHERE ID2 = 1 OR ID2 = 2". 
 A logic course would fix most of these problems of course ...

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


Thread
Problems with simple(?) queryJames Dyer11 Nov
Re: Problems with simple(?) queryDan Nelson11 Nov
RE: Problems with simple(?) queryPeter Grigor11 Nov
Re: Problems with simple(?) queryKeith C. Ivey11 Nov
  • Re: Problems with simple(?) queryMichael T. Babcock11 Nov
Re: Problems with simple(?) queryJohn Ragan12 Nov
  • How stable is MySQL 4.x vs 3.23.x?Jaime Teng12 Nov
    • Re: How stable is MySQL 4.x vs 3.23.x?Jeremy Zawodny12 Nov
  • RE: Problems with simple(?) queryArthur Fuller18 Nov
RE: How stable is MySQL 4.x vs 3.23.x?Kelly W [PCS] Black12 Nov