Justin Palmer wrote:
Hi List,
I have the following query where I am trying to locate a single students
record. I only know that the students record has an id of 3690 and an
employer_id of 3 possibles. So I thought that OR would work great. The
problem is that it returns all students with empl
Justin Palmer wrote:
Hi List,
I have the following query where I am trying to locate a single students
record. I only know that the students record has an id of 3690 and an
employer_id of 3 possibles. So I thought that OR would work great. The
problem is that it returns all students with emp
At 01:54 PM 2/17/2004, walt wrote:
>> (SELECT FROM table WHERE condition1) UNION (SELECT FROM table WHERE
>> condition2);
Ah, interesting... I'll play around with UNION to see if that will do the
trick for me.
Right off the bat, I am able to get a fast query with it, but the output
isn't quite,
Bill,
Someone sent this too the list the other day.
>> MySQL's optimizer has a slight problem. OR queries cause it to get very
>> confused.
>>
>> Try the following to get the best performance:
>>
>> Rewrite SELECT FROM table WHERE (condition1) OR (condition2);
>>
>> As:
>>
>> (SELECT FROM table WH
> is there any way turn the following query to all ands instead of using an
> or?
>
> select f1,f2,f3 from table1 where (f1 ='monday' or f2 ='monday') and
> f3='34';
SELECT f1,f2,f3 FROM table1 WHERE 'monday' IN (f1, f2) AND f3 = '34';
--