MySQL Forums
Forum List  »  Newbie

Re: Listing all, plus column from bridging table, for specific ID.
Posted by: Jay Pipes
Date: July 12, 2005 12:26PM

SELECT
c.ClassID
, s.Name as Student
, IFNULL(e.Grade, '-') as Grade
FROM Class c
LEFT JOIN Enrolled e
ON c.ClassID = e.Class
AND e.Student = 43
CROSS JOIN Student s
WHERE s.StudentID = 43;

Of course, I've assumed the column names here...

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Written By
Posted
Re: Listing all, plus column from bridging table, for specific ID.
July 12, 2005 12:26PM


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.