Reputation: 450
This query is returning the error "ambiguous column name courses.scheduleNumber". I searched for a solution to the problem, however, a commonly suggested fix was to qualify all of the column names with the table name, which I have already done.
SELECT
courses.scheduleNumber,
courses.subject,
courses.courseNumber,
courses.sectionNumber,
courses.credits,
courses.title,
courses.room,
courses.days,
rooms.building,
rooms.room,
courses.startTime,
courses.endTime,
courses.instructor
FROM courses
LEFT JOIN courseRooms
ON courses.scheduleNumber=courseRooms.scheduleNumber
LEFT JOIN courses
ON courseRooms.building=rooms.building AND courseRooms.room=rooms.room;
Upvotes: 0
Views: 515
Reputation: 13544
Two "courses" in your from clause. Replace the "courses" in final left join with "rooms". It should work then.
Upvotes: 0
Reputation: 14409
I think you mean for that final LEFT JOIN courses
to be a LEFT JOIN rooms
?
Upvotes: 8