此查询如何创建逗号分隔列表SQL Server?
SELECT E1.deptno, allemp = Replace ((SELECT E2.ename AS 'data()' FROM emp AS e2 WHERE e1.deptno = e2.DEPTNO FOR xml PATH('')), ' ', ', ') FROM EMP AS e1 GROUP BY DEPTNO;
10 CLARK, KING, MILLER20 SMITH, JONES, SCOTT, ADAMS, FORD30 ALLEN, WARD, MARTIN, BLAKE, TURNER, JAMES
ibeautiful
繁星淼淼
相关分类