How to sort words in a column in mysql? I have data as 

id action
1  a
1  b
2  b
2  a
3  c


I wrote code as 

select id,group_concat(action SEPARATOR ' ')
from table1;


It ends up as 

id action
1  a b
2  b a
3  c


Actually, ba and ab is the same one, how could we sort it?
GROUP_CONCAT accepts ORDER BY ,so your query becomes

select id,group_concat(action ORDER BY action SEPARATOR ' ') from table1;