比如,我们要查看每个人的多个分数,将该人对应的多个分数显示在一起,分数要从高到底排序。可以这样写:
SELECT username,GROUP_CONCAT(score ORDER BY score DESC) AS myScore FROM t1 GROUP BY username;
比如,我们要查看每个人的多个分数,将该人对应的多个分数显示在一起,分数要从高到底排序。可以这样写:
SELECT username,GROUP_CONCAT(score ORDER BY score DESC) AS myScore FROM t1 GROUP BY username;