Check out example codes for "convert rows to string sql server". It will help you in understanding the concepts better.

Code Example 1

Select CountryName from Application.Countries 
 
Declare @val Varchar(MAX); 
Select @val = COALESCE(@val + ', ' + CountryName, CountryName) 
        From Application.Countries Select @val;

Learn ReactJs, React Native from akashmittal.com