MySQL: Sort GROUP_CONCAT values

Sure, see http://dev.mysql.com/doc/refman/…tions.html#function_group-concat:

SELECT student_name,
  GROUP_CONCAT(DISTINCT test_score ORDER BY test_score DESC SEPARATOR ' ')
  FROM student
  GROUP BY student_name;

Leave a Comment