WITH TMP AS ( SELECT '이수진' AS supy_nm, '710' as sl_cd from dual union all SELECT '이수진' AS supy_nm, '711' as sl_cd from dual ) select supy_nm, max(sl_cd) as sl_cd from tmp group by supy_nm ; WITH TMP AS ( SELECT '이수진' AS supy_nm, '710' as sl_cd from dual union all SELECT '이수진' AS supy_nm, '711' as sl_cd from dual ) select supy_nm, sl_cd from ( select supy_nm, sl_cd, row_number() over (partition by supy_nm order by sl_cd desc) as rnum from tmp ) where rnum = 1 ;