Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何从数据库中水平获取垂直数据(学生的科目和分数)?
我在谷歌浪费了一整天,但没有结果。任何人都可以帮忙吗?
你可以利用group_concat函数,
group_concat
例如 :
SELECT group_concat(subject,':',marks) FROM students;
您的输出将如下所示:
english:93,maths:87,science:91 ...,etc