我刚刚在 SQL Server 上学习 SQL。我需要将多行连接成一列。我已经找了一些例子,但没有找到一个我可以用来满足我需要的例子。
Country ProjectTA Complexity TID Sites Inits Name
United States A8022 Obesity Low 4692 69 JT AD
United States A8022 Obesity Low 4692 69 jpni CBM Budget
United States A8022 Obesity Low 4692 69 PIHR AD
United States A8022 Obesity Low 4692 69 jpni CBM Budget
United States A8022 Obesity Low 4692 69 hale ePublishing Group
United States S8033 CNS Medium 5423 69 ShyP CBM Payment
United States S8033 CNS Medium 5423 69 dedu ePublishing Group
United States S8033 CNS Low 5423 69 AHrp ePublishing Group
我想按名称连接行并用“,”列出 Inits
United States A8022 Obesity Low 4692 69 JT,PIHR AD
United States A8022 Obesity Low 4692 69 jpni, PIHR CBM Budget
United States A8022 Obesity Low 4692 69 hale ePublishing Group
United States S8033 CNS Medium 5423 69 ShyP CBM Payment
United States S8033 CNS Medium 5423 69 dedu, Ahrp ePublishing Group
任何帮助,将不胜感激。非常感谢。