You can use DENSE_RANK()
function, if your database is eligible to use window functions such as
SELECT model, maker, price
FROM(SELECT pc.model, pc.maker, pc.price,
DENSE_RANK() OVER (PARTITION BY pc.maker ORDER BY pc.price DESC) AS dr
FROM pc
JOIN product pr
ON pr.model = pc.model
AND pr.maker = 'Dell' ) p
WHERE dr = 1
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…