Check out example codes for "group by mysql and concatenate string". It will help you in understanding the concepts better.

Code Example 1

mysql> select Id,group_concat(Name SEPARATOR ',') as GroupConcatDemo from GroupConcatenateDemo
   -> group by Id;

Learn ReactJs, React Native from akashmittal.com