अन्य स्तंभों के लिए बस इसी विधि का उपयोग करें:
SELECT
t.Department,
Worker =
STUFF((
SELECT ';' + Worker
FROM tbl
WHERE Department = t.Department
ORDER BY Worker
FOR XML PATH(''), TYPE
).value('text()[1]','NVARCHAR(MAX)'), 1, 1, N''),
Phone =
STUFF((
SELECT ';' + Phone
FROM tbl
WHERE Department = t.Department
ORDER BY Worker
FOR XML PATH(''), TYPE
).value('text()[1]','NVARCHAR(MAX)'), 1, 1, N''),
Ext =
STUFF((
SELECT ';' + Ext
FROM tbl
WHERE Department = t.Department
ORDER BY Worker
FOR XML PATH(''), TYPE
).value('text()[1]','NVARCHAR(MAX)'), 1, 1, N'')
FROM tbl t
GROUP BY t.Department