I have a table like this:
id value
1 a
1 b
2 c
2 d
2 e
I want to combine rows with the same ids into one,here is what i want as result:
id value
1 a b
2 c d e
I have a table like this:
id value
1 a
1 b
2 c
2 d
2 e
I want to combine rows with the same ids into one,here is what i want as result:
id value
1 a b
2 c d e
try this
select id,group_concat(value) as value from tb_name group by id;
if you want space instead ',' then try below query
select id,replace(group_concat(value), ',' ,' ') as value from tb_name group by id;