Advertisement
ma39isy

Untitled

Mar 27th, 2024
1,111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.     LECTURERCODE,
  3.     NIP,
  4.     EMPLOYEESNAME,
  5.     TIPEDOSEN,
  6.     ACADEMICGRADESID,
  7.     SALARY,
  8.     ROUND(NVL(SKS,
  9.     0),
  10.     2) SKS,
  11.     ROUND(NVL(SKS_KOOR,
  12.     0),
  13.     2) SKS_KOOR,
  14.     ROUND(NVL(SKS,
  15.     0)+ NVL(SKS_KOOR,
  16.     0),
  17.     2) TOTALSKS
  18. FROM
  19.     LECTURERVIEW
  20. JOIN (
  21.     SELECT
  22.         LECTURERCODE,
  23.         SUM(SKS) SKS
  24.     FROM
  25.         (
  26.         SELECT
  27.             LECTURERCODE,
  28.             SUM(CREDIT_MAIN_LECTURECODE) SKS
  29.         FROM
  30.             COURSE
  31.         JOIN SUBJECTS
  32.                 USING (SUBJECTID)
  33.         WHERE
  34.             ACTIVATEDSTATUS = 'YA'
  35.             AND LECTURERCODE IS NOT NULL
  36.             AND SCHOOLYEAR = '2324'
  37.             AND SEMESTER = '2'
  38.         GROUP BY
  39.             LECTURERCODE
  40.     UNION ALL
  41.         SELECT
  42.             A.LECTURERCODE,
  43.             SUM(A.CREDIT) SKS
  44.         FROM
  45.             COURSE_TEACHING_TEAM A
  46.         JOIN COURSE
  47.                 USING (COURSEID)
  48.         JOIN SUBJECTS
  49.                 USING (SUBJECTID)
  50.         WHERE
  51.             ACTIVATEDSTATUS = 'YA'
  52.             AND A.LECTURERCODE IS NOT NULL
  53.             AND SCHOOLYEAR = '2324'
  54.             AND SEMESTER = '2'
  55.         GROUP BY
  56.             A.LECTURERCODE
  57.                     )
  58.     GROUP BY
  59.         LECTURERCODE)
  60.         USING (LECTURERCODE)
  61. LEFT JOIN (
  62.     SELECT
  63.         COURSECOORDINATOR,
  64.         COUNT(DISTINCT SUBJECTID) SKS_KOOR
  65.     FROM
  66.         COURSE
  67.     JOIN SUBJECTS
  68.             USING (SUBJECTID)
  69.     WHERE
  70.         ACTIVATEDSTATUS = 'YA'
  71.         AND COURSECOORDINATOR IS NOT NULL
  72.         AND SCHOOLYEAR = '2324'
  73.         AND SEMESTER = '2'
  74.     GROUP BY
  75.         COURSECOORDINATOR) ON
  76.     (COURSECOORDINATOR = LECTURERCODE)
  77. ORDER BY
  78.     NIP ASC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement