SP:
INNER JOIN StudentSubjectMapping SS ON SM.StudentID=SS.StudentID
WHERE SM.CourseID=@CourseID OR @CourseID=0
AND SM.ClassID=@ClassID OR @ClassID=0
AND SM.ClassSectionID=@ClassSectionID OR @ClassSectionID=0
AND SD.StudentID <> SS.StudentID
答案 0 :(得分:4)
尝试在以下内容中添加括号$('.mobile-nav-toggle').on('click', function() {
var status = $(this).hasClass('is-open');
if (status) {
$('.mobile-nav-toggle, .mobile-nav').removeClass('is-open');
} else {
$('.mobile-nav-toggle, .mobile-nav').addClass('is-open');
}
});
:
()
答案 1 :(得分:1)
使用LEFT JOIN
代替
LEFT JOIN StudentSubjectMapping SS ON SM.StudentID=SS.StudentID
WHERE SM.CourseID=@CourseID OR @CourseID=0
AND SM.ClassID=@ClassID OR @ClassID=0
AND SM.ClassSectionID=@ClassSectionID OR @ClassSectionID=0
AND SS.StudentID IS NULL
答案 2 :(得分:1)
您可以使用NOT IN
选择StudentIDs
中不存在的StudentSubjectMapping
INNER JOIN StudentSubjectMapping SS ON SM.StudentID=SS.StudentID
WHERE (SM.CourseID=@CourseID OR @CourseID=0)
AND (SM.ClassID=@ClassID OR @ClassID=0)
AND (SM.ClassSectionID=@ClassSectionID OR @ClassSectionID=0)
AND (SD.StudentID NOT IN (SELECT StudentID FROM StudentSubjectMapping))
答案 3 :(得分:1)
感谢您的支持。回答:
WHERE
(SM.CourseID=@CourseID OR @CourseID=0)
AND
(SM.ClassID=@ClassID OR @ClassID=0)
AND
(SM.ClassSectionID=@ClassSectionID OR @ClassSectionID=0)
AND
SM.StudentID NOT IN (SELECT StudentID FROM StudentSubjectMapping)