1. As you are inserting into the temp table, the column name alias like 'רҵÃû' etc are not required at all.
select distinct ClassesInfo.classSpecialty as 'רҵÃû', Courses.courseID as '¿Î³Ì±àºÅ', Courses.courseName as '¿Î³ÌÃû³Æ',
Courses.coursePeriod as '¿Î³Ìѧʱ', Courses.courseCredit as '¿Î³Ìѧ·Ö', -- Missing comma here
Courses.courseKind,
2. The number of columns does not match of the result set does not matched number of columns in the temp table. The temp table does not have a column for '¿Î³ÌÀàÐÍ'.
3. You need to specify the join condition between the 2 table Courses and ClassInfo
select distinct . . .
from Courses c inner join ClassesInfo ci
on c.some_columne = ci.some_column
where . . .
4. The where statement is also wrong. Think this is what you want.
[code]
where studentCourseID not in (select distinct studentCourseID from StudentCoursesInfo
where not exists(select distinct studentID from StudentsInfo where studentClassID = classID))
KH