From MySQL Docs, GROUP_CONCAT supports ORDER BY
mysql> SELECT student_name,
-> GROUP_CONCAT(DISTINCT test_score
-> ORDER BY test_score DESC SEPARATOR ' ')
-> FROM student
-> GROUP BY student_name;
Try this:
fn.GROUP_CONCAT(Clause(
SQL('Distinct'),
MyModel.test_score,
SQL('ORDER BY'),
MyModel.test_score,
SQL('DESC SEPARATOR \' \'')))
Not very clean but that should hopefully help you get the SQL you need.
Most helpful comment
Try this:
Not very clean but that should hopefully help you get the SQL you need.