I have a database for exercises. I would like to list out the maximum price of different types with the corresponding title name, but of course I can't just put the title name attribute into my SELECT clause, because it does not appear in the GROUP BY clause. Is there any solution to my problem? Thanks!
SELECT type, MAX(price) "price"
FROM titles
GROUP BY type
ORDER BY type DESC;