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

Code Example 1

DECLARE @csv VARCHAR(MAX)
SELECT @csv = COALESCE(@csv + ',' ,'') + book_title from Test.dbo.Books where book_id IN ( 101, 102, 103);
SELECT @csv 

Output
Head First SQL, SQL Puzzler, T-SQL Fundamentals

Learn ReactJs, React Native from akashmittal.com