Advertisement
ma39isy

Untitled

Aug 8th, 2024
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.     DISTINCT
  3.                 S.STUDENTID,  
  4.                 S.FULLNAME,  
  5.                 S.CLASS,  
  6.                 S.CLASS2,  
  7.                 S.CLASS3,  
  8.                 F.GPA,  
  9.                 S.LECTURERCODE,  
  10.                 S.ACTIVESTATUS,  
  11.                 S.STUDYPROGRAMID,  
  12.                 S.STUDENTSCHOOLYEAR,  
  13.                 S.STUDYFIELD,  
  14.                 S.OUTDATE,  
  15.                 S.PARTICIPANTNUMBER,  
  16.                 S.NOTES,  
  17.                 S.STUDENTTYPEID,  
  18.                 S.STARTDATE,  
  19.                 S.CLASSIFICATIONID,  
  20.                 ST.STUDENTTYPENAME,  
  21.                 CASE
  22.         WHEN UPPER(C.CLASSIFICATIONNAME) LIKE '%INTER%CLASS%' THEN C.CLASSIFICATIONNAME
  23.         ELSE SP.STUDYPROGRAMNAME
  24.     END AS STUDYPROGRAMNAME,      
  25.                 T.PHONE,  
  26.                 (
  27.     SELECT  
  28.                     VALUE
  29.     FROM  
  30.                     MASTERDATA.ACCOUNT
  31.     WHERE  
  32.                     STUDENTID = S.STUDENTID
  33.         AND INFOID IN (7, 8, 26)
  34.         AND VALUE IS NOT NULL
  35.         AND ROWNUM <= 1
  36.                 ) EMAIL,  
  37.                 'email_unitel' EMAILINSTITUSI,  
  38.                 TAK,  
  39.                 GENDER,
  40.                 CASE
  41.         WHEN UPPER(C.CLASSIFICATIONNAME) LIKE '%INTER%CLASS%'
  42.         OR S.STUDYPROGRAMID = 40
  43.         OR UPPER(SP.STUDYPROGRAMNAME) LIKE '%INTER%CLASS%' THEN 'KELAS INT'
  44.         WHEN UPPER(C.CLASSIFICATIONNAME) LIKE '%PINDAHAN%'
  45.         OR UPPER(SP.STUDYPROGRAMNAME) LIKE '%PINDAHAN%' THEN 'PINDAHAN'
  46.         ELSE 'REGULER'
  47.     END AS PROGRAMTYPE,  
  48.                 AD.NATIONALITY,  
  49.                 TO_CHAR (AD.BIRTHDATE,
  50.     'DD-MM-YYYY') BIRTHDATE,
  51.                 DESCRIPTIONOFSELECTIONPATH,
  52.                 TO_CHAR(S.OUTDATE, 'DD-MM-YYYY') GRADUATEDATE,
  53.                 PASS_CREDIT,
  54.                 S.NOTES AS NOTE,
  55.                 UPPER(AC.YUDISIUMSTATUS) YUDISIUMSTATUS
  56. FROM  
  57.             MASTERDATA.STUDENT S
  58. LEFT JOIN MASTERDATA.ADDITIONALSTUDENTDATA AD ON
  59.     (S.STUDENTID = AD.STUDENTID)
  60. LEFT JOIN MASTERDATA.STUDENTTYPE ST ON
  61.     (S.STUDENTTYPEID = ST.STUDENTTYPEID)
  62. LEFT JOIN MASTERDATA.STUDYPROGRAM SP ON
  63.     (S.STUDYPROGRAMID = SP.STUDYPROGRAMID)
  64. LEFT JOIN ACADEMIC.GPASTUDENT F ON
  65.     (F.STUDENTID = S.STUDENTID)
  66. LEFT JOIN (
  67.     SELECT  
  68.                     MAX(VALUE) PHONE,  
  69.                     STUDENTID
  70.     FROM  
  71.                     MASTERDATA."ACCOUNT"
  72.     WHERE  
  73.                     INFOID = 22
  74.     GROUP BY  
  75.                     STUDENTID
  76.             ) T ON
  77.     (T.STUDENTID = S.STUDENTID)
  78. LEFT JOIN MASTERDATA.STUDENT_TOKEN ON
  79.     (S.STUDENTID = "nim")
  80. LEFT JOIN (
  81.     SELECT  
  82.                     STUDENTID,  
  83.                     SUM(MHS_POINT) TAK
  84.     FROM  
  85.                     TAK.VIEW_STUDENT_TAK
  86.     GROUP BY  
  87.                     STUDENTID
  88.             ) TA ON
  89.     (S.STUDENTID = TA.STUDENTID)
  90. LEFT JOIN ADMISSION.SELECTIONPATHS ON
  91.     (SELECTIONPATH = SELECTIONPATHID)
  92. LEFT JOIN MASTERDATA.STUDYPROGRAMCLASSIFICATION C ON
  93.     (S.CLASSIFICATIONID = C.CLASSIFICATIONID)
  94. LEFT JOIN (
  95.     SELECT
  96.                 STUDENTID,  
  97.                     ACADEMICCOUNCILNAME,  
  98.                     YUDISIUMSTATUS
  99.     FROM
  100.         (
  101.         SELECT  
  102.                     STUDENTID,  
  103.                     ACADEMICCOUNCILNAME,  
  104.                     YUDISIUMSTATUS,
  105.                     ROW_NUMBER() OVER (PARTITION BY STUDENTID
  106.         ORDER BY
  107.             ACADEMICCOUNCILDATE DESC NULLS LAST,
  108.             inputdate DESC NULLS LAST) AS rno
  109.         FROM  
  110.                     ACADEMIC.ACADEMICSTATUS
  111.         WHERE  
  112.                     ACADEMICCOUNCILNAME IN ('DIPLOMA', 'SARJANA', 'MAGISTER')
  113.                 AND ACADEMICCOUNCILDATE IS NOT NULL
  114.                     )
  115.     WHERE
  116.         rno = 1
  117.             ) AC ON
  118.     (S.STUDENTID = AC.STUDENTID)
  119. WHERE  
  120.                 1 = 1
  121.                 SP.FACULTYID IN (
  122.     SELECT
  123.         FACULTYID
  124.     FROM
  125.         ACADEMIC.USEROFFACULTY
  126.     WHERE
  127.         USERID = '166607')
  128.     AND st.STUDYPROGRAMID = '31'
  129.     AND REGPROGRAM IS NULL
  130.     AND S.STUDENTSCHOOLYEAR = '2324'
  131. ORDER BY
  132.             S.STUDENTID ASC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement