Use analytical function as follows:
select * from
(select t.*,
row_number() over (partition by kodenrp order by idjurusan) as rn
from your_table t) t
where rn = 1
Or use NOT EXISTS
as follows:
select t.*
from your_table t
where not exists
(select 1 from your_Table tt
where t.kodenrp = tt.kodenrp and tt.idjurusan < t.idjhurusan)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…