Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- A.*,
- TO_CHAR(A.BIRTHDATE, 'DD/MM/YYYY') AS BIRTHDATE
- FROM
- (
- SELECT
- *
- FROM
- STUDENT S
- LEFT JOIN ADDITIONALSTUDENTDATA
- USING(STUDENTID)
- LEFT JOIN STUDYPROGRAM SP ON
- (DECODE(S.CLASSIFICATIONID, '64', '64', S.STUDYPROGRAMID)= SP.STUDYPROGRAMID)
- LEFT JOIN FACULTIES
- USING(FACULTYID)
- LEFT JOIN (
- SELECT
- F.STUDENTID,
- F.FAMILYNAME AS FATHER,
- I.FAMILYNAME AS MOTHER
- FROM
- STUDENTSFAMILY F
- FULL JOIN STUDENTSFAMILY I ON
- (F.STUDENTID = I.STUDENTID)
- WHERE
- F.RELATIONSHIP = 'FATHER'
- AND I.RELATIONSHIP = 'MOTHER')
- USING(STUDENTID)
- LEFT JOIN
- (
- SELECT
- STUDENTID,
- VALUE AS CELLPHONE
- FROM
- account
- LEFT JOIN ADDITIONALINFO
- USING(INFOID)
- WHERE
- INFONAME = 'CELLPHONE')
- USING (STUDENTID)
- LEFT JOIN
- (
- SELECT
- STUDENTID,
- VALUE AS ORIGINPHONE
- FROM
- account
- LEFT JOIN ADDITIONALINFO
- USING(INFOID)
- WHERE
- INFONAME = 'ORIGINPHONE')
- USING (STUDENTID)
- WHERE
- STUDENTID = '6706213100' ) A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement