MySQL合并多行为一行
程序员文章站
2022-04-22 21:49:23
...
SELECT stu.Sname,GROUP_CONCAT(cou.Cname SEPARATOR ' , ') as 选课 from sc as s join student as stu ON s.SId = stu.SId
JOIN course as cou on cou.CId = s.CId
GROUP BY stu.Sname
下一篇: Hive的一行拆分多行