SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE VIEW [test].[offene_Auftraege_gesamt_S08] AS
SELECT [Serviceberater]
     , sum([Tage_offen]) AS [Tage_offen]
     , sum([DG]) AS [DG]
     , sum([Teile]) AS [Teile]
     , sum([Lohn]) AS [Lohn]
     , sum([ben_Std]) AS [ben_Std]
FROM (SELECT [Invoice_Date]
           , [Serviceberater]
           , [Tage_offen]
           , [DG]
           , 0.0 AS [Teile]
           , 0.0 AS [Lohn]
           , 0.0 AS [ben_Std]
      FROM [transform].[offene_Auftraege_DG_Anz_Tage]
      UNION ALL

      SELECT [Invoice_Date]
           , [Serviceberater]
           , 0.0 AS [Tage_offen]
           , 0.0 AS [DG]
           , [Teile]
           , 0.0 AS [Lohn]
           , 0.0 AS [ben_Std]
      FROM [transform].[offene_Auftraege_Teile]
      UNION ALL

      SELECT [Invoice_Date]
           , [Serviceberater]
           , 0.0 AS [Tage_offen]
           , 0.0 AS [DG]
           , 0.0 AS [Teile]
           , [Lohn]
           , [ben_Std]
      FROM [transform].[offene_Auftraege_Ums_ben_AW]) [V1]

GROUP BY [Serviceberater]
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
