Id Type Price
1 A 100.00
2 C 80.00
3 A 130.00
4 B 90.00
5 B 100.00
6 C 120.00
7 A 90.00
8 C 90.00
9 B 80.00
select avg(t.Price) as avgpr, t.Type as Type from table t group by t.Type order by avgpr desc
参考自:
MySQL如何优化GROUP BY http://www.data.5helpyou.com/article237.html
select avg(Price) as avgpr, Type from table group by Type order by avgpr desc