Reputation: 59
I need to merge few columns into one row in mysql, separated by some char (; or dot), from:
Id Item Options
1 Charger iphone
2 Car black
3 Food vege
into:
Items
"Charger; Car; Food"
Upvotes: 0
Views: 29
Reputation: 1269503
You are looking for group_concat()
, presumably:
select id, group_concat(item separator '; ') as items
from t
group by id;
Upvotes: 3