我想结合这些查询结果

时间:2019-07-18 09:23:52

标签: sql-server

我要合并此查询,请帮助

select Semester,StudentID,CourseCode,AssignmentTitle,Score,CourseWeekName,MarksObtained
from (
           (
      select t.BatchID, t.TraineeID, t.VideoStartTime, t.VideoEndTime, t.VideoDuration,l.Week
      from dm.vTraineeActivity t
      inner join dm.vLessonDimension l 
      on t.LessonKey=l.LessonKey and t.BatchID=l.BatchID 
      where t.BatchID in (1,2)
    ) Vidoess

 (
      select sa.Semester, sa.StudentID, sa.CourseCode, sa.AssignmentTitle, sa.Score, sa.CourseWeekName
      from dstp_dm.lms.vStudentAssignment sa
      where semester in (1,2)
      and CourseWeekName <='Week 04'
    ) assign

full outer join
(
select Semester, StudentID, CourseCode, MarksObtained
from dstp_dm.lms.vStudentQuizResult 
where semester in (1,2)
    and CourseWeekName <='Week 04'
) quiz

0 个答案:

没有答案