SELECT * FROM
(
SELECT *, MAX(field) AS max_field
FROM mytable
GROUP BY field_id
) t
ORDER BY max_field
其中,field,field_id应替换成具体的列名,mytable替换成具体的表名
SELECT * FROM
(
SELECT *, MAX(field) AS max_field
FROM mytable
GROUP BY field_id
) t
ORDER BY max_field
其中,field,field_id应替换成具体的列名,mytable替换成具体的表名
评论