I would like to ask how to realize grouping queries like mysql.

  mysql, question

I would like to ask, this table图片描述

If you group yourself with commands, the result is incorrect.图片描述

The result is displayed as qiu 42 (should be liu 42). How is this displayed图片描述

I wrote it myself.图片描述
Only one category of inside can be displayed. How can the maximum age of all categories of inside be displayed?
If it is written like this, it will be a screenshot like this.图片描述

First order:

SELECT id, name, max(age), class FROM (SELECT * FROM test ORDER BY age DESC) T GROUP BY class