表1:
id,studname,course
1,AAA,EnglishI
1,AAA,Basic programming
1,AAA,EnglishII
1,AAA,Maths
2,BBB,programming
2,BBB,IT Essential
2,BBB,Maths
表2:
1,AAA,(EnglishI,Basic programming,EnglishII,Maths)-serialization
2,BBB,(programming, IT Essential, Maths)
如何?请帮助我..
答案 0 :(得分:1)
试试这个:
SELECT id, studname, GROUP_CONCAT(course) FROM table GROUP BY studname