Missing a 'LAST_VALUE() OVER w' for one of the views. user/csharp/update_money_views_with_window_functions_rebased
authorChris Sharp <csharp@georgialibraries.org>
Mon, 10 Nov 2014 14:09:32 +0000 (09:09 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 10 Nov 2014 14:09:32 +0000 (09:09 -0500)
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/sql/Pg/080.schema.money.sql

index c630a24..c528967 100644 (file)
@@ -85,7 +85,7 @@ CREATE OR REPLACE RULE money_payment_view_update AS ON UPDATE TO money.payment_v
 
 CREATE OR REPLACE VIEW money.transaction_billing_type_summary AS
     SELECT DISTINCT billing.xact,
-        billing.billing_type AS last_billing_type,
+        LAST_VALUE(billing.billing_type) OVER w AS last_billing_type,
         LAST_VALUE(billing.note) OVER w AS last_billing_note,
         MAX(billing.billing_ts) OVER w AS last_billing_ts,
         SUM(COALESCE(billing.amount, 0::numeric)) OVER w AS total_owed