This query isn't what I want...

select a.rhrqid,a.rhrqsid,a.rhrssid,b.sid,b.rlsid
from rqhistory a left join relay b
on a.rhrqsid = 101 or a.rhrssid = 101
and (a.rhrqid = b.rqid and (a.rhrqsid = b.rlsid or a.rhrqsid = b.sid or
a.rhrssid = b.rlsid or a.rhrssid = b.sid))

because it returns all rows from 'a' regardless of the criteria 101

Any advice on how would I get only rows from 'a' that match 101 and any in
'b' that match if they exist?

-km
-- 
View this message in context: 
http://www.nabble.com/outer-join-question-tf3178361.html#a8819711
Sent from the MySQL - General mailing list archive at Nabble.com.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to