select id_plan_dasar,id_plan,no_urut,deskripsi, kelas, dbo.func_getderetkelas(kelas) kelas, risiko, status
from plan_detail 
WHERE Id_Plan_dasar='0211' 
ORDER BY id_plan, no_Urut

SELECT * FROM dbo.spaj_register WHERE no_spaj='N102387'
SELECT * FROM dbo.spaj_register_plan WHERE no_spaj='N102387'

SELECT
    id_plan_dasar,
    id_plan,
    no_urut,
    deskripsi,
    dbo.func_getderetkelas(kelas) kelas,
    risiko,
    status
FROM
    plan_detail
WHERE
    Id_Plan_dasar = '0211'
    --AND kelas<>'0'
ORDER BY
    id_plan,
    no_Urut
    
SELECT * FROM dbo.plan_detail WHERE id_plan='1118'
--0210