SELECT
*
FROM
( SELECT * FROM achievements WHERE department_id = "xxx" ORDER BY sp2 DESC LIMIT 10000) a
GROUP BY
a.sp1
mysql5.7以后需要加limit排序才生效
SELECT
*
FROM
( SELECT * FROM achievements WHERE department_id = "xxx" ORDER BY sp2 DESC LIMIT 10000) a
GROUP BY
a.sp1
mysql5.7以后需要加limit排序才生效