[SQL] Must I use DISTINCT?

2009-02-05 Thread Michael B Allen
Please consider the following SQL SELECT e.eid, e.name FROM entry e, access a WHERE e.eid = 120 AND (e.ownid = 66 OR e.aid = a.aid) The intent is to match one entry with the eid of 120. However I would like to impose an additional constraint that either e.ownid must be 66 or e.aid must

Re: [SQL] Must I use DISTINCT?

2009-02-05 Thread Rajesh Kumar Mallah
have you tried Join using , eg SELECT e.eid, e.name FROM entry e join access a ON( e.eid = 120 AND (e.ownid = 66 OR e.aid = a.aid) ) ; some sample data might also help in understanding the prob more clrearly. regds rajesh kumar mallah. On Fri, Feb 6, 2009 at 3:27 AM, Michael B Allen

Re: [SQL] Must I use DISTINCT?

2009-02-05 Thread Michael B Allen
On Thu, Feb 5, 2009 at 10:59 PM, Rajesh Kumar Mallah mallah.raj...@gmail.com wrote: have you tried Join using , eg SELECT e.eid, e.name FROM entry e join access a ON( e.eid = 120 AND (e.ownid = 66 OR e.aid = a.aid) ) ; some sample data might also help in understanding the prob more

Re: [SQL] Must I use DISTINCT?

2009-02-05 Thread Stephan Szabo
On Thu, 5 Feb 2009, Michael B Allen wrote: Please consider the following SQL SELECT e.eid, e.name FROM entry e, access a WHERE e.eid = 120 AND (e.ownid = 66 OR e.aid = a.aid) The intent is to match one entry with the eid of 120. However I would like to impose an additional

Re: [SQL] Must I use DISTINCT?

2009-02-05 Thread Raj Mathur
On Friday 06 Feb 2009, Michael B Allen wrote: On Thu, Feb 5, 2009 at 10:59 PM, Rajesh Kumar Mallah mallah.raj...@gmail.com wrote: have you tried Join using , eg SELECT e.eid, e.name FROM entry e join access a ON( e.eid = 120 AND (e.ownid = 66 OR e.aid = a.aid) ) ; some sample