根据c1,c2分组,并且根据c3排序,取第一行
select tt.*
from (select row_number() over(partition by c1, c2 order by c3 desc) r,
t.*
from test_table t) tt
where tt.r = 1
oracle分组并在组内排序
最新推荐文章于 2023-01-20 10:28:08 发布
根据c1,c2分组,并且根据c3排序,取第一行
select tt.*
from (select row_number() over(partition by c1, c2 order by c3 desc) r,
t.*
from test_table t) tt
where tt.r = 1