0% found this document useful (0 votes)
87 views

Random Oracle Queries and Functions

This SQL query selects student data from various tables including college, registration status for a given term, latest student status code, student ID, name, email, and term. It joins the student, registration, and email tables and filters for active students using the maximum valid registration term that is less than or equal to the given term parameter.

Uploaded by

AUK IT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views

Random Oracle Queries and Functions

This SQL query selects student data from various tables including college, registration status for a given term, latest student status code, student ID, name, email, and term. It joins the student, registration, and email tables and filters for active students using the maximum valid registration term that is less than or equal to the given term parameter.

Uploaded by

AUK IT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

SELECT SGBSTDN_COLL_CODE_1 College,F_REGISTERED_THIS_TERM(A.

SPRIDEN_PIDM,:DD_Term)
registered_This_Term,B.SGBSTDN_STST_CODE,SGBSTDN_TERM_CODE_EFF Latest_Status_AS_Of,
A.SPRIDEN_ID STUDENT_ID,
f_format_name(A.SPRIDEN_PIDM,'FML') STUDENT_NAME,
C.GOREMAL_EMAIL_ADDRESS EMAIL_ADDRESS,
B.SGBSTDN_TERM_CODE_EFF TERM
FROM SGBSTDN B , SPRIDEN A LEFT JOIN GOREMAL C ON (A.SPRIDEN_PIDM = C.GOREMAL_PIDM
AND C.GOREMAL_PREFERRED_IND = 'Y' AND C.GOREMAL_EMAL_CODE = 'AUKE')
WHERE A.SPRIDEN_PIDM = B.SGBSTDN_PIDM
AND A.SPRIDEN_CHANGE_IND IS NULL
AND B.SGBSTDN_TERM_CODE_EFF = (SELECT MAX(S.SGBSTDN_TERM_CODE_EFF)
from SATURN.SGBSTDN S
where S.SGBSTDN_PIDM = B.SGBSTDN_PIDM
AND S.SGBSTDN_TERM_CODE_EFF NOT LIKE '%00'
AND S.SGBSTDN_TERM_CODE_EFF <= :DD_Term)
--AND B.SGBSTDN_TERM_CODE_EFF = :DD_Term
AND B.SGBSTDN_STST_CODE in ('AS')
--and F_REGISTERED_THIS_TERM(A.SPRIDEN_PIDM,:DD_Term) ='Y'
--and B.SGBSTDN_STST_CODE='AS'
--and :BTN_run is not null
--order by A.SPRIDEN_ID
--order by B.SGBSTDN_STST_CODE desc
order by B.SGBSTDN_TERM_CODE_EFF desc

You might also like