SQL group_concat function in SQL Server [duplicate]
问题 This question already has answers here : Simulating group_concat MySQL function in Microsoft SQL Server 2005? (10 answers) Closed 3 years ago . If there is a table called employee EmpID EmpName ---------- ------------- 1 Mary 1 John 1 Sam 2 Alaina 2 Edward Result I need in this format: EmpID EmpName ---------- ------------- 1 Mary, John, Sam 2 Alaina, Edward Q: this record is in same Employee table. I have almost no experience using UDFs, stored procedures, I need to be done this thing