• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

How to write this query?

Hmongkeysauce

Senior member
Let's say I have a table name Course. For simplicity, a simplified structure is below:

course_num | name | prereq_course_num

Prereq_course_num is a foreign key referencing Course(course_num).
What would the query look like if I wanted to get the course name, and the name of its pre-req. Note that a course may have only one prereq, but obviously, more than one course may have the same prereq.
 
Something like "select a.name, b.name from Course a left outer join Course b where a.prereq_course_num = b.course_num"
 
prereq courses should be in a child table IMO to allow you to have multiple prereqs for a single course. Just an observation 🙂.
 
Back
Top