我不明白为什么我的查询无法正常工作,请帮助
select *
from
(
select Semester, StudentID, CourseCode, MarksObtained,CourseWeekName
from dstp_dm.lms.vStudentQuizResult
where CourseWeekName<='Week 04'
) aa
Full Outer join
(
select Semester,StudentID,CourseCode,Score,CourseWeekName
from lms.vStudentAssignment
where CourseWeekName<='Week 04'
)
答案 0 :(得分:0)
可能是因为where CourseWeekName<='Week 04'
。如我所见,CourseWeekName
是字符串,而不是数字,因此您不能使用像<=
答案 1 :(得分:0)
第二个表中缺少别名
select aa.*,bb.*
from
(
select Semester, StudentID, CourseCode, MarksObtained,CourseWeekName
from dstp_dm.lms.vStudentQuizResult
where CourseWeekName<='Week 04'
) aa
Full Outer join
(
select Semester,StudentID,CourseCode,Score,CourseWeekName
from lms.vStudentAssignment
where CourseWeekName<='Week 04'
)bb on aa.StudentID=bb.StudentID
答案 2 :(得分:0)
FULL OUTER JOIN
仍然需要一个JOIN
条件(on col1 = col2
)
什么不起作用?查询是引发错误还是给出错误的结果?
如果查询运行但给出错误结果,则分别运行。