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
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 employer_id's of 3, 78, 79.
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
I've noticed that If I use an OR in my query, mysql seems to choose not to
use my indexes. Though, it would seem to help (as, if I do the query in
two steps, I can get faster results than as one query).
Is there some way I can convince mysql to use my keys with an OR, or
perhaps another way to
There is a really strange thing happening with mysql 3.23.52.
mysql is getting stuck in a select query, the query is a straight join between table
a,b and c
The problem arises when i give condition to search c.nId for 2 values then it is
taking large amount of time to excute this query and is g
or (field = "x" and (field = "a" or field = "b" or field = "c"));
>
> assuming that you want a record with "x" in field having either
>
> y or z in field or a or b o c in field
>
> HATH
>
> -Original Message-
> From:
uot;x" in field having either
y or z in field or a or b o c in field
HATH
-Original Message-
From: Petre Agenbag [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 2:49 PM
To: [EMAIL PROTECTED]
Subject: and & or in query
Hi
I would like to issue a logical query as follow:
select
On 12 Sep 2002, at 23:48, Petre Agenbag wrote:
> select * from table where field1 = "x" and ((field2 = "y" or field2 =
> "z") or (field3 = "a" or field3 = "b" or field3 = "c"));
>
> But this syntax is not returning what I expect.
The syntax looks fine (though the inner sets of parentheses aren'
Hi
I would like to issue a logical query as follow:
select * from table where field1 = "x" and ((field2 = "y" or field2 =
"z") or (field3 = "a" or field3 = "b" or field3 = "c"));
But this syntax is not returning what I expect.
Plz help me with syntax
---
p.s., if you reply, kindly CC me as well.
hi, i have the following SQL query
select col1 from table1
where
col2 = 'xxx' or col3 = 'xxx'
how can i get rid of this OR? due to my table design and the logic
involved, i have to check both these 2 columns (in a search function). i
cannot
> 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';
--
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';
Thanks
Randy
-
Before posting, please check:
http://www.mysql.co
14 matches
Mail list logo