SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE VIEW [test_systemvergleich].[Zeit_gesamt_Z03] AS
SELECT T1.Periode
     , T1.Standort_Name
     , T1.Monteur_Gruppe_2
     , T1.Monteur
     , T1.Anw         AS Anw_Kunde
     , T2.Anw         AS Anw_ETL
     , T1.prod        AS prod_Kunde
     , T2.prod        AS prod_ETL
     , T1.verr_Zeit   AS verr_Zeit_Kunde
     , T2.verr_Zeit   AS verr_Zeit_ETL
     , T1.ben_Zeit    AS ben_Zeit_Kunde
     , T2.ben_Zeit    AS ben_Zeit_ETL
     , T1.Umsatz_Lohn AS Umsatz_Lohn_Kunde
     , T2.Umsatz_Lohn AS Umsatz_Lohn_ETL
     , T1.Abw         AS Abw_Kunde
     , T2.Abw         AS Abw_ETL
     , T1.Sollzeit    AS Sollzeit_Kunde
     , T2.Sollzeit    AS Sollzeit_ETL
     , T1.Prod_Faktor AS Prod_Faktor_Kunde
     , T2.Prod_Faktor AS Prod_Faktor_ETL
from GC.test.Zeit_gesamt_Z03 T1
         FULL OUTER JOIN test.Zeit_gesamt_Z03 T2 ON
    T1.Periode = T2.Periode AND
    T1.Standort_Name = T2.Standort_Name AND
    T1.Monteur_Gruppe_2 = T2.Monteur_Gruppe_2 AND
    T1.Monteur = T2.Monteur
WHERE T1.[Anw] is null
   OR T2.[Anw] is null
   OR round([T1].[Anw] - [T2].[Anw], 2) <> 0.00
   OR round([T1].[prod] - [T2].[prod], 2) <> 0.00
   OR round([T1].[verr_Zeit] - [T2].[verr_Zeit], 2) <> 0.00
   OR round([T1].[ben_Zeit] - [T2].[ben_Zeit], 2) <> 0.00
   OR round([T1].[Umsatz_Lohn] - [T2].[Umsatz_Lohn], 2) <> 0.00
   OR round([T1].[Abw] - [T2].[Abw], 2) <> 0.00
   OR round([T1].[Sollzeit] - [T2].[Sollzeit], 2) <> 0.00
   OR round([T1].[Prod_Faktor] - [T2].[Prod_Faktor], 2) <> 0.00
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
