This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION transkrip(CHAR) | |
RETURNS TABLE(nim CHAR, kode_mk CHAR, nama_mk CHAR, nilai CHAR) AS | |
$$ | |
BEGIN | |
RETURN QUERY | |
SELECT tmp1.nim, tmp1.kode_mk, tmp1.nama_mk, tmp1.nilai | |
FROM ( | |
SELECT A.nim, A.kode_mk, B.nama_mk, A.nilai | |
, row_number() over(partition by A.kode_mk order by A.nilai) baris |