select max, group by and display other column that's not in group by clause

Viewed 14245

To keep it short, I have found a tutorial online and followed to the point: http://www.tizag.com/mysqlTutorial/mysqlmax.php

SELECT type, MAX(price) FROM products GROUP BY type

My question is: How do I echo which "clothing" is the most expensive (In this case "Blouse")?

UPDATE:


Sorry guys, my bad. I needed to make myself more clear. What I am looking for is a solution that shows each "name" where they are most expensive:

name         type          price

Clothing    Blouse         34.97

Toy       Playstation      89.95

Music     Country Tunes    21.55
5 Answers
Related