where used |
+-+++-+-+---
+---+-+
My question: Is it possible to setup the query to tell mysql to search the
smallest subset only when you have a conditional AND in this kind of join.
Thanks in advance.
regards
David
-
Before posti
TED]]
Sent: 06 July 2001 20:19
To: Jason Ward; LIste de Mysql
Subject: Re: conditional AND
I write this:
"Select p.name
>From tab_person p, tab_list l
Where l.id_tab_list = 18 And
l.id_person = 0 Or
l.id_person = p.id_person"
i will receve a
I write this:
"Select p.name
>From tab_person p, tab_list l
Where l.id_tab_list = 18 And
l.id_person = 0 Or
l.id_person = p.id_person"
i will receve all name in person table!
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
François Boucher
[EMAIL PROTECTED]
___
_
no one else replies I will give you the syntax
you require.
Jason
-Original Message-
From: franky [mailto:[EMAIL PROTECTED]]
Sent: 06 July 2001 20:12
To: Jason Ward; LIste de Mysql
Subject: Re: conditional AND
I try it but it like the OR has no effect
ot;
-Original Message-
From: Jason Ward [mailto:[EMAIL PROTECTED]]
Sent: 06 July 2001 19:29
To: franky; LIste de Mysql
Subject: RE: conditional AND
Selectp.name
fromtab_person p, tab_list l
wherel.id_tab_list = 18
and ((l.id_person != 0 AND l.id_person = p.id_person)
or l.id_per
Selectp.name
fromtab_person p, tab_list l
wherel.id_tab_list = 18
and ((l.id_person != 0 AND l.id_person = p.id_person)
or l.id_person = 0)
}
-Original Message-
From: franky [mailto:[EMAIL PROTECTED]]
Sent: 06 July 2001 19:35
To: LIste de Mysql
Subject: conditional AND
Hi
Hi
I want to make query like this
Selectp.name
fromtab_person p, tab_list l
wherel.id_tab_list = 18
if (l.id_person != 0){
AND l.id_person = p.id_person
}
table person
id_person,name,tel
table list
id_list,id_person,title
how can i do?
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-