Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT s.LAST_NAME+', '+s.FIRST_NAME+' '+COALESCE(s.MIDDLE_NAME,' ') AS FULL_NAME,s.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME,s.STUDENT_ID,ssm.SCHOOL_ID,ssm.SCHOOL_ID AS LIST_SCHOOL_ID,ssm.GRADE_ID ,
- sg1.BENCHMARK_ID,
- sg1.GRADE_TITLE,
- sg1.COMMENT AS COMMENT_TITLE,
- ssm.STUDENT_ID,
- sg1.MARKING_PERIOD_ID,
- com.COMMENT AS LONGER_COURSE_COMMENTS,
- sp2.SORT_ORDER,
- sched.COURSE_PERIOD_ID
- FROM STUDENTS s,STUDENT_ENROLLMENT ssm
- LEFT JOIN SCHEDULE sched
- ON sched.STUDENT_ID=ssm.STUDENT_ID
- LEFT JOIN STUDENT_REPORT_CARD_BENCHMARKS sg1
- ON (
- sg1.STUDENT_ID=sched.STUDENT_ID AND
- sg1.COURSE_PERIOD_ID=sched.COURSE_PERIOD_ID AND
- CAST(sg1.MARKING_PERIOD_ID AS VARCHAR(10)) IN ('255') AND
- sg1.SYEAR=sched.SYEAR
- )
- LEFT JOIN COURSE_PERIODS rc_cp
- ON (
- rc_cp.COURSE_PERIOD_ID=sg1.COURSE_PERIOD_ID AND
- rc_cp.DOES_GRADES='Y'
- )
- LEFT JOIN SCHOOL_PERIODS sp2
- ON sp2.PERIOD_ID=rc_cp.PERIOD_ID
- LEFT JOIN STUDENT_REPORT_CARD_COURSE_COMMENTS com
- ON (
- com.STUDENT_ID=sched.STUDENT_ID AND
- com.MARKING_PERIOD_ID=CAST(sg1.MARKING_PERIOD_ID AS VARCHAR(10)) AND
- com.COURSE_PERIOD_ID=sched.COURSE_PERIOD_ID
- )
- ,SCHEDULE w_ss WHERE ssm.STUDENT_ID=s.STUDENT_ID AND ssm.SCHOOL_ID='1' AND ssm.SYEAR='2014' AND ('24-OCT-14' BETWEEN ssm.START_DATE AND ssm.END_DATE OR (ssm.END_DATE IS NULL)) AND
- sched.MARKING_PERIOD_ID IN ('0','252','254','255') AND
- ('24-OCT-14' BETWEEN sched.START_DATE AND sched.END_DATE OR (sched.END_DATE IS NULL AND '24-OCT-14'>=sched.START_DATE)) AND w_ss.STUDENT_ID=s.STUDENT_ID AND w_ss.SYEAR=ssm.SYEAR AND w_ss.SCHOOL_ID=ssm.SCHOOL_ID AND w_ss.COURSE_PERIOD_ID='7811' AND ('24-OCT-14' BETWEEN w_ss.START_DATE AND w_ss.END_DATE OR w_ss.END_DATE IS NULL) AND s.STUDENT_ID IN ('30297') ORDER BY s.LAST_NAME,s.FIRST_NAME
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement