SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE VIEW [test_systemvergleich].[Aftersales_Rechnungen_Focus_Group] AS
SELECT T1.Jahr
     , T1.Hauptbetrieb_ID
     , T1.Standort_ID
     , T1.Parts_Focus_Group
     , T1.Parts_Make_Desc
     , T1.Menge_Focus AS Menge_Focus_Kunde
     , T2.Menge_Focus AS Menge_Focus_ETL
FROM [GC].test.Aftersales_Rechnungen_Focus_Group T1
         FULL OUTER JOIN test.Aftersales_Rechnungen_Focus_Group T2 ON
    T1.Jahr = T2.Jahr AND
    T1.Hauptbetrieb_ID = T2.Hauptbetrieb_ID AND
    T1.Standort_ID = T2.Standort_ID AND
    T1.Parts_Focus_Group = T2.Parts_Focus_Group AND
    T1.Parts_Make_Desc = T2.Parts_Make_Desc
WHERE T1.[Menge_Focus] is null
   OR T2.[Menge_Focus] is null
   OR round([T1].[Menge_Focus] - [T2].[Menge_Focus], 2) <> 0.00
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
