我有一个 SQL 查询:
SELECT [B].[Id]
,[B].[CreateDate]
,[Author]
,[B].[WorkcenterId]
,[B].[AreaId]
,[B].[SubAreaId]
,[B].[Description]
,[PriorityId]
,[BreakdownStatusEnum]
,[ApproveDate]
,[StartDate]
,[FinishedDate]
,[BreakdownStartCheckListId]
,[ApprovedBy]
,[BreakdownReason]
,[D].[Name] AS ResponsibleDepartment
FROM [Breakdowns_Kohl].[dbo].[Breakdowns] AS [B]
INNER JOIN Workcenters AS [WC] ON B.WorkcenterId = WC.Id
INNER JOIN SubAreas AS [S] ON B.SubAreaId = S.Id
INNER JOIN Areas AS [A] ON B.AreaId = A.ID
LEFT JOIN Relation_Department_Workcenter AS REL_DW ON B.WorkcenterId = REL_DW.WorkcenterId
LEFT JOIN Department AS [D] ON REL_DW.DepartmentId = D.Id
我无法弄清楚如何将它放入最后一列并用逗号分隔的单行中,例如: