--方法一 select B,MIN(A)KEEP(DENSE_RANK FIRST ORDER BY C DESC) A, MIN(C)KEEP(DENSE_RANK FIRST ORDER BY C DESC) C, MIN(D)KEEP(DENSE_RANK FIRST ORDER BY C DESC) D from table_name group by B;--方法二 select A,B,C,D from (select A,B,C,D,ROW_NUMBER()OVER(PARTITION BY B ORDER BY C DESC) ROW_ from table_name) where row_=1;
select A,B,C,D from (select A,B,C,D,ROW_NUMBER()OVER(PARTITION BY B ORDER BY C DESC) ROW_ from table_name) where row_=1;
--方法一
select B,MIN(A)KEEP(DENSE_RANK FIRST ORDER BY C DESC) A,
MIN(C)KEEP(DENSE_RANK FIRST ORDER BY C DESC) C,
MIN(D)KEEP(DENSE_RANK FIRST ORDER BY C DESC) D
from table_name
group by B;--方法二
select A,B,C,D
from
(select A,B,C,D,ROW_NUMBER()OVER(PARTITION BY B ORDER BY C DESC) ROW_
from table_name)
where row_=1;
from
(select A,B,C,D,ROW_NUMBER()OVER(PARTITION BY B ORDER BY C DESC) ROW_
from table_name)
where row_=1;