MySQL Forums
Forum List  »  Newbie

Re: can I use two join in a single query ?
Posted by: Peter Brawley
Date: September 27, 2012 07:48AM

Return all rows in a which match rows in b which match or don't match rows in c:

select a.*
from a
join b on a.akey=b.bkey
left join c on b.bkey=c.ckey;

Return all rows in a which match or don't match rows in b which match rows in c:

select a.*
from a
left join b on a.akey=b.bkey
join c on b.bkey=c.ckey;

Options: ReplyQuote


Subject
Written By
Posted
Re: can I use two join in a single query ?
September 27, 2012 07:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.