SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE VIEW [test_systemvergleich].[Aftersales_Rechnungen_verk_AW_final] AS
SELECT T1.Jahr
     , T1.Hauptbetrieb_ID
     , T1.Standort_ID
     , T1.Fabrikat
     , T1.verk_Std AS verk_Std_Kunde
     , T2.verk_Std AS verk_Std_ETL
FROM GC.test.Aftersales_Rechnungen_verk_AW_final T1
         FULL OUTER JOIN test.Aftersales_Rechnungen_verk_AW_final T2 ON
    T1.Jahr = T2.Jahr AND
    T1.Hauptbetrieb_ID = T2.Hauptbetrieb_ID AND
    T1.Standort_ID = T2.Standort_ID AND
    T1.Fabrikat = T2.Fabrikat
WHERE T1.[verk_Std] is null
   OR T2.[verk_Std] is null
   OR round([T1].[verk_Std] - [T2].[verk_Std], 2) <> 0.00
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
