Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

T-SQL Equivalent For Group_Concat() Function

$
0
0
Hello, I am looking for a way to do the MSSQL T-SQL equivalent of the MySQL aggregate function: group_concat().

We are running SQL 2005 Express. Is there a pure T-SQL way to do this, or if not, a way to create a new custom aggregate function?

EX:

SELECT GROUP_CONCAT(FIRST_NAME) AS STUDENT_LIST FROM STUDENTS GROUP BY TEACHER

OUTPUT:

JOSH,JOEY,MARK,LINDA,PAM,BILL,MIKE,JUSTIN


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>