不明确的列名

时间:2015-05-16 20:28:36

标签: sql select

我不知道这可能有什么问题:

请帮帮我:/

SELECT 
   Name, CourseID,  CourseName,  MeetingDays, MeetingTime, ProfID 
FROM  
   Course,  CourseSection,  Student
WHERE 
   Course.CourseID = CourseSection.CourseID
ORDER BY 
   Name, CourseName

1 个答案:

答案 0 :(得分:0)

列名CourseID出现在两个表中。为了做到正确,请使用<tablename>.CourseID之类的:

SELECT Name, Course.CourseID,  CourseName,  MeetingDays, MeetingTime, ProfID 

FROM  Course,  CourseSection,  Student

WHERE Course.CourseID = CourseSection.CourseID

ORDER BY Name, CourseName