select product_id, product_name, type, price from ( select product_id, price, type, product_name, rank() over(partition by type order by price desc ) as rn from product_info order by price desc )a where rn < 3 limit 3