此函數於SQL server 2017 版 後可使用
用途: 使用group by 的時候連接內容
用法:
STRING_AGG(a.str,’,’) AS ‘內容’
會用逗號將字串連接起來
參考:
https://docs.microsoft.com/zh-tw/sql/t-sql/functions/string-agg-transact-sql?view=sql-server-ver15
https://www.sqlservertutorial.net/sql-server-string-functions/sql-server-string_agg-function/