Stack Overflow Asked on January 3, 2022
I have records like this after applying joins
id name item
1 bil Books
2 mike Table
2 mike chair
3 josh pen
3 josh pencil
4 peter copy
But, I want them to look like this
id name item
1 bil Books
2 mike Table,chair
3 josh pen, pencil
4 peter copy
How to achieve this?
Use group by
and group_concat()
:
select id, name, group_concat(item) items
from mytable
group by id, name
Answered by GMB on January 3, 2022
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP