sql分组求最大值

select * from
(
select *,ROW_NUMBER() OVER(PARTITION BY type ORDER BY typeindex DESC) as num
from test
) t
where t.num = 1

https://chuna2.787528.xyz/lakeliu/p/11943946.html

posted @ 2022-01-07 17:42  娜乌西卡在路上  阅读(223)  评论(0)    收藏  举报