select * from(select *,ROW_NUMBER() OVER(PARTITION BY type ORDER BY typeindex DESC) as numfrom test) twhere t.num = 1
https://chuna2.787528.xyz/lakeliu/p/11943946.html