Concat Rows in MSSQL
https://mreschke.com/138/concat-rows-in-mssql
How to return a comma separated list, in one column, from a field in multiple rows. If you have, for example, email addresses on multiple rows in a table but want to return them as one column, comma separated. Example: Database table ID | report_id | email | 1 | 1 | email1@email.com 2 | 1 | email2@email.com 3 | 1 | email3@email.com I want a return of report_id | email -| 1 | email1@emailcom,email2@email.com,email3@email.com To achieve this, you must create a user defined function which will conc...