You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+ " COALESCE(CASE pd.IsDeduction WHEN 1 THEN NULL ELSE ConvertedCalculatedValue END, 0) NetPrice ,\n"
79
+
+ " COALESCE(CASE pd.IsDeduction WHEN 1 THEN ConvertedCalculatedValue ELSE NULL END, 0) NetDeductionPrice ,\n"
80
+
+ " pd.QualityIndicator ,\n"
81
+
+ " row_number() OVER (PARTITION BY pd.TheMonth , pd.IdentifyingKey ORDER BY COALESCE(pd.QualityMonth, to_date('18991230', 'yyyymmdd')) DESC ) RowNumberMain ,\n"
+ " COALESCE(CASE pd.IsDeduction WHEN 1 THEN NULL ELSE ConvertedCalculatedValue END, 0) NetPrice ,\n"
92
+
+ " COALESCE(CASE pd.IsDeduction WHEN 1 THEN ConvertedCalculatedValue ELSE NULL END, 0) NetDeductionPrice ,\n"
93
+
+ " pd.QualityIndicator ,\n"
94
+
+ " NULL RowNumberMain ,\n"
95
+
+ " row_number() OVER (PARTITION BY pd.TheMonth , pd.IdentifyingKey ORDER BY COALESCE(pd.QualityMonth, to_date('18991230', 'yyyymmdd')) DESC ) RowNumberDeduction \n"
96
+
+ " FROM PricingData pd\n"
97
+
+ " WHERE pd.ThingsKey IN (:ThingsKeys)\n"
98
+
+ " AND pd.TheMonth >= :startdate\n"
99
+
+ " AND pd.TheMonth <= :enddate\n"
100
+
+ " AND pd.IsDeduction <> 0\n"
101
+
+ " )\n"
102
+
+ "GROUP BY TheMonth ,\n"
103
+
+ " IdentifyingKey\n"
104
+
+ ") Data ON ( Dest.TheMonth = Data.TheMonth \n"
105
+
+ " AND COALESCE(Dest.IdentifyingKey,0) = Data.IdentifyingKey )\n"
106
+
+ "WHEN MATCHED THEN\n"
107
+
+ " UPDATE\n"
108
+
+ " SET NetPrice = ROUND(Data.NetPrice, PriceDecimalScale) ,\n"
0 commit comments