以下是样本数据。
Op_ID manual TT ------------------ 1 0 32 1 1 38.4 2 0 4.56 2 1 7.5 55 1 50 55 1 30
So i need the output like below.
Op_ID manual TT ------------------ 1 0 32 2 0 4.56 55 1 50
答案 0 :(得分:1)
select opid, manual, tt
from (
select *, row_number() over (partition by opid order by manual, tt desc) rn
from yourtable ) v
where rn = 1