题解 | 商品价格排名
商品价格排名
https://www.nowcoder.com/practice/119f5b8cfe5b45779a3e1b3f4d83b341
select a.product_id,a.product_name,a.type,a.price from (select dense_rank() over(PARTITION BY type ORDER BY price DESC ) as rank_id, product_id,product_name,type,price from product_info ) as a where rank_id<=2 order by a.price desc ,a.product_name limit 3