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.
这是我的餐桌信息
Id Name 1 aaa 1 bbb 2 ccc 2 ddd
ID是重复的。现在我想要这样的结果
1 aaa,bbb 2 ccc,ddd
我怎样才能在 Mysql 中做到这一点?
使用GROUP_CONCAT()
select id, group_concat(name) as names from your_table group by id