select distinct spriden_id, spriden_last_name, Spriden_first_name,
Sfrstcr_term_code, SFRSTCR_CRN, SFRSTCR_GRDE_CODE, GRDE_CODE_FINAL
from spriden, sfrstcr
left join (select shrtckn_pidm, SHRTCKG_GRDE_CODE_FINAL as GRDE_CODE_FINAL
from shrtckn, shrtckg
where SHRTCKN_PIDM = SHRTCKG_PIDM
and shrtckg_term_code = shrtckn_term_code
and shrtckn_seq_no = shrtckg_tckn_seq_no
and shrtckg_seq_no =
(select max(shrtckg_seq_no) from shrtckg
where shrtckg_pidm = shrtckn_pidm
and shrtckg_term_code = shrtckn_term_code
and shrtckg_tckn_seq_no = shrtckn_seq_no)
and shrtckn_subj_code like ('S%')
and not ("SHRTCKN_CRSE_NUMB" LIKE '%L' OR "SHRTCKN_CRSE_NUMB" LIKE '%R')
and shrtckn_term_code = '201901') on GRDE_CODE_FINAL.pidm
where spriden_id like ('%900%')
and Sfrstcr_term_code = &term
and spriden_pidm = sfrstcr_pidm
Sfrstcr_term_code, SFRSTCR_CRN, SFRSTCR_GRDE_CODE, GRDE_CODE_FINAL
from spriden, sfrstcr
left join (select shrtckn_pidm, SHRTCKG_GRDE_CODE_FINAL as GRDE_CODE_FINAL
from shrtckn, shrtckg
where SHRTCKN_PIDM = SHRTCKG_PIDM
and shrtckg_term_code = shrtckn_term_code
and shrtckn_seq_no = shrtckg_tckn_seq_no
and shrtckg_seq_no =
(select max(shrtckg_seq_no) from shrtckg
where shrtckg_pidm = shrtckn_pidm
and shrtckg_term_code = shrtckn_term_code
and shrtckg_tckn_seq_no = shrtckn_seq_no)
and shrtckn_subj_code like ('S%')
and not ("SHRTCKN_CRSE_NUMB" LIKE '%L' OR "SHRTCKN_CRSE_NUMB" LIKE '%R')
and shrtckn_term_code = '201901') on GRDE_CODE_FINAL.pidm
where spriden_id like ('%900%')
and Sfrstcr_term_code = &term
and spriden_pidm = sfrstcr_pidm