with
t1 as (
select
*,
dense_rank() over (
partition by
type
order by
price desc
) as rk
from
product_info
)
select
product_id,
product_name,
type,
price
from
t1
where
rk <= 2
order by
price desc,
product_name asc
limit
3


京公网安备 11010502036488号