SELECT DISTINCT
(SELECT COUNT("SUBJEK"."PD04MATRIK")
FROM "SUBJEK"
WHERE "SUBJEK"."PD04KODMP" = "SENARAI"."PD02KODMP" AND
"SUBJEK"."PD04SETMP" = "SENARAI"."PD02SETMP" AND
"SUBJEK"."PD04SESI" = :gs_sesi AND
"SUBJEK"."PD04SEMESTER" = :gs_semester ) AS EKSTRAPELAJAR,
(SELECT COUNT("SUBJEK"."PD04MATRIK")-30
FROM "SUBJEK"
WHERE "SUBJEK"."PD04KODMP" = "SENARAI"."PD02KODMP" AND
"SUBJEK"."PD04SETMP" = "SENARAI"."PD02SETMP" AND
"SUBJEK"."PD04SESI" = :gs_sesi AND
"SUBJEK"."PD04SEMESTER" = :gs_semester) AS KIRATOLAK30,
(SELECT (COUNT("SUBJEK"."PD04MATRIK")-30)*2/60
FROM "SUBJEK"
WHERE "SUBJEK"."PD04KODMP" = "SENARAI"."PD02KODMP" AND
"SUBJEK"."PD04SETMP" = "SENARAI"."PD02SETMP" AND
"SUBJEK"."PD04SESI" = :gs_sesi AND
"SUBJEK"."PD04SEMESTER" = :gs_semester) AS KIRAMINIT,
(CASE
WHEN (SELECT (COUNT("SUBJEK"."PD04MATRIK")- 30)*2/60
FROM "SUBJEK"
WHERE "SUBJEK"."PD04KODMP" = "SENARAI"."PD02KODMP"
AND "SUBJEK"."PD04SETMP" = "SENARAI"."PD02SETMP"
AND "SUBJEK"."PD04SESI" = :gs_sesi
AND "SUBJEK"."PD04SEMESTER" = :gs_semester) < 0 THEN 0.00
ELSE (SELECT (COUNT("SUBJEK"."PD04MATRIK")-30)*2/60
FROM "SUBJEK"
WHERE "SUBJEK"."PD04KODMP" = "SENARAI"."PD02KODMP"
AND "SUBJEK"."PD04SETMP" = "SENARAI"."PD02SETMP"
AND "SUBJEK"."PD04SESI" = :gs_sesi
AND "SUBJEK"."PD04SEMESTER" = :gs_semester)
END) AS KIRAMINIT_2,
"BEBAN_PENGAJARAN"."NOSTAF",
"BEBAN_PENGAJARAN"."KODMP",
"BEBAN_PENGAJARAN"."SEKSYEN",
"BEBAN_PENGAJARAN"."SESI",
"BEBAN_PENGAJARAN"."SEM",
"SENARAI"."PD02THPPGN",
"SENARAI"."PD02K",
"BEBAN_PENGAJARAN"."JUM_BEBAN",
"BEBAN_PENGAJARAN"."KREDIT",
"BEBAN_PENGAJARAN"."MP_BAYAR"
FROM "PENSYARAH",
"BEBAN_PENGAJARAN",
"SENARAI"
WHERE BEBAN_PENGAJARAN.nostaf (+) = PENSYARAH.pd02pensy AND
BEBAN_PENGAJARAN.kodmp (+) = PENSYARAH.pd02kodmp AND
BEBAN_PENGAJARAN.seksyen (+) = PENSYARAH.pd02setmp AND
BEBAN_PENGAJARAN.sesi (+) = PENSYARAH.pd02sesi AND
BEBAN_PENGAJARAN.sem (+) = PENSYARAH.pd02semester AND
"PENSYARAH"."PD02KODMP" = "SENARAI"."PD02KODMP" AND
"PENSYARAH"."PD02SESI" = "SENARAI"."PD02SESI" AND
"PENSYARAH"."PD02SEMESTER" = "SENARAI"."PD02SEMESTER" AND
"PENSYARAH"."PD02SETMP" = "SENARAI"."PD02SETMP" AND
"PENSYARAH"."PD02PENSY" = :gs_nostaf AND
"PENSYARAH"."PD02SESI" = :gs_sesi AND
"PENSYARAH"."PD02SEMESTER" = :gs_semester
(SELECT COUNT("SUBJEK"."PD04MATRIK")
FROM "SUBJEK"
WHERE "SUBJEK"."PD04KODMP" = "SENARAI"."PD02KODMP" AND
"SUBJEK"."PD04SETMP" = "SENARAI"."PD02SETMP" AND
"SUBJEK"."PD04SESI" = :gs_sesi AND
"SUBJEK"."PD04SEMESTER" = :gs_semester ) AS EKSTRAPELAJAR,
(SELECT COUNT("SUBJEK"."PD04MATRIK")-30
FROM "SUBJEK"
WHERE "SUBJEK"."PD04KODMP" = "SENARAI"."PD02KODMP" AND
"SUBJEK"."PD04SETMP" = "SENARAI"."PD02SETMP" AND
"SUBJEK"."PD04SESI" = :gs_sesi AND
"SUBJEK"."PD04SEMESTER" = :gs_semester) AS KIRATOLAK30,
(SELECT (COUNT("SUBJEK"."PD04MATRIK")-30)*2/60
FROM "SUBJEK"
WHERE "SUBJEK"."PD04KODMP" = "SENARAI"."PD02KODMP" AND
"SUBJEK"."PD04SETMP" = "SENARAI"."PD02SETMP" AND
"SUBJEK"."PD04SESI" = :gs_sesi AND
"SUBJEK"."PD04SEMESTER" = :gs_semester) AS KIRAMINIT,
(CASE
WHEN (SELECT (COUNT("SUBJEK"."PD04MATRIK")- 30)*2/60
FROM "SUBJEK"
WHERE "SUBJEK"."PD04KODMP" = "SENARAI"."PD02KODMP"
AND "SUBJEK"."PD04SETMP" = "SENARAI"."PD02SETMP"
AND "SUBJEK"."PD04SESI" = :gs_sesi
AND "SUBJEK"."PD04SEMESTER" = :gs_semester) < 0 THEN 0.00
ELSE (SELECT (COUNT("SUBJEK"."PD04MATRIK")-30)*2/60
FROM "SUBJEK"
WHERE "SUBJEK"."PD04KODMP" = "SENARAI"."PD02KODMP"
AND "SUBJEK"."PD04SETMP" = "SENARAI"."PD02SETMP"
AND "SUBJEK"."PD04SESI" = :gs_sesi
AND "SUBJEK"."PD04SEMESTER" = :gs_semester)
END) AS KIRAMINIT_2,
"BEBAN_PENGAJARAN"."NOSTAF",
"BEBAN_PENGAJARAN"."KODMP",
"BEBAN_PENGAJARAN"."SEKSYEN",
"BEBAN_PENGAJARAN"."SESI",
"BEBAN_PENGAJARAN"."SEM",
"SENARAI"."PD02THPPGN",
"SENARAI"."PD02K",
"BEBAN_PENGAJARAN"."JUM_BEBAN",
"BEBAN_PENGAJARAN"."KREDIT",
"BEBAN_PENGAJARAN"."MP_BAYAR"
FROM "PENSYARAH",
"BEBAN_PENGAJARAN",
"SENARAI"
WHERE BEBAN_PENGAJARAN.nostaf (+) = PENSYARAH.pd02pensy AND
BEBAN_PENGAJARAN.kodmp (+) = PENSYARAH.pd02kodmp AND
BEBAN_PENGAJARAN.seksyen (+) = PENSYARAH.pd02setmp AND
BEBAN_PENGAJARAN.sesi (+) = PENSYARAH.pd02sesi AND
BEBAN_PENGAJARAN.sem (+) = PENSYARAH.pd02semester AND
"PENSYARAH"."PD02KODMP" = "SENARAI"."PD02KODMP" AND
"PENSYARAH"."PD02SESI" = "SENARAI"."PD02SESI" AND
"PENSYARAH"."PD02SEMESTER" = "SENARAI"."PD02SEMESTER" AND
"PENSYARAH"."PD02SETMP" = "SENARAI"."PD02SETMP" AND
"PENSYARAH"."PD02PENSY" = :gs_nostaf AND
"PENSYARAH"."PD02SESI" = :gs_sesi AND
"PENSYARAH"."PD02SEMESTER" = :gs_semester
* output utama sebenarnya nak kira jumlah pelajar untuk seseorang pensyarah, bagi sesi tertentu, semester tertentu dan seksyen tertentu
*case kiraminit_2 nak jadikan nilai '-'ve kepada 0.00 dan setkan nilai yang telah dibuat pengiraan
--to be continued
No comments:
Post a Comment