MySQL Forums
Forum List  »  MySQL Query Browser

Re: MySQL Query: JOIN rows of 1 table
Posted by: Chad Bourque
Date: May 21, 2010 01:57PM

Steve,

Use table aliases:

select a.studentid, a.result academic, p.result physical
  from table a
    join table p
      on a.studentid = p.studentid
        and a.branch = 'ACADEMIC'
        and p.branch = 'PHYSICAL'
  order by a.result desc, p.result desc;

HTH,
Chad

Options: ReplyQuote


Subject
Written By
Posted
Re: MySQL Query: JOIN rows of 1 table
May 21, 2010 01:57PM


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.