-
Notifications
You must be signed in to change notification settings - Fork 2
/
ieef-sections.sql
28 lines (27 loc) · 1.4 KB
/
ieef-sections.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
SELECT
MSS_SCHEDULE_TERM_DATE.TMD_END_DATE as TermEnd,
MSS_SCHOOL.SKL_SCHOOL_ID as SchoolId,
MSS_STAFF.STF_ID_LOCAL as Teacher1,
'' as Teacher2,
'' as Teacher3,
MSS_SCHEDULE_TERM.TRM_TERM_NAME as TermName,
MSS_SCHEDULE_MASTER.MST_OID as SectionId,
MSS_SCHEDULE_TERM_DATE.TMD_START_DATE as TermStart,
MSS_SCHEDULE_MASTER.MST_DESCRIPTION as CourseName,
MSS_COURSE_SCHOOL.CSK_COURSE_NUMBER as CourseNumber,
MSS_SCHEDULE_MASTER.MST_SECTION_NUMBER as SectionNumber,
MSS_SCHEDULE_MASTER.MST_DESCRIPTION as CourseDescription
FROM
MSS_SCHEDULE_MASTER
LEFT OUTER JOIN MSS_SCHEDULE ON MSS_SCHEDULE_MASTER.MST_SCH_OID=MSS_SCHEDULE.SCH_OID
LEFT OUTER JOIN MSS_SCHOOL ON MSS_SCHEDULE.SCH_SKL_OID=MSS_SCHOOL.SKL_OID
LEFT OUTER JOIN MSS_SCHEDULE_TERM ON MSS_SCHEDULE_MASTER.MST_TRM_OID=MSS_SCHEDULE_TERM.TRM_OID
LEFT OUTER JOIN MSS_SCHEDULE_TERM_DATE ON MSS_SCHEDULE_TERM.TRM_OID=MSS_SCHEDULE_TERM_DATE.TMD_TRM_OID
LEFT OUTER JOIN MSS_STAFF ON MSS_SCHEDULE_MASTER.MST_STF_OID_PRIMARY=MSS_STAFF.STF_OID
LEFT OUTER JOIN MSS_COURSE_SCHOOL ON MSS_SCHEDULE_MASTER.MST_CSK_OID=MSS_COURSE_SCHOOL.CSK_OID
LEFT OUTER JOIN MSS_DISTRICT_SCHOOL_YEAR_CONTEXT ON MSS_SCHEDULE.SCH_CTX_OID=MSS_DISTRICT_SCHOOL_YEAR_CONTEXT.CTX_OID
WHERE
MSS_DISTRICT_SCHOOL_YEAR_CONTEXT.CTX_FIELDA_001 = 'Current'
AND MSS_COURSE_SCHOOL.CSK_COURSE_NUMBER NOT IN ('FASA', 'NAC')
AND MSS_SCHEDULE_TERM_DATE.TMD_END_DATE IS NOT NULL
ORDER BY TermEnd DESC;