From: Chris Sharp Date: Mon, 10 Nov 2014 14:09:32 +0000 (-0500) Subject: Missing a 'LAST_VALUE() OVER w' for one of the views. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fcsharp%2Fupdate_money_views_with_window_functions_rebased;p=working%2FEvergreen.git Missing a 'LAST_VALUE() OVER w' for one of the views. Signed-off-by: Chris Sharp --- diff --git a/Open-ILS/src/sql/Pg/080.schema.money.sql b/Open-ILS/src/sql/Pg/080.schema.money.sql index c630a24214..c528967db0 100644 --- a/Open-ILS/src/sql/Pg/080.schema.money.sql +++ b/Open-ILS/src/sql/Pg/080.schema.money.sql @@ -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