From ffac38745ee3a8e413f7bd1b28093ee337a4ed38 Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 11 Dec 2008 19:26:08 +0000 Subject: [PATCH] logic fix to new bibs-by-holdings-change view git-svn-id: svn://svn.open-ils.org/ILS/trunk@11525 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/extend-reporter.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/sql/Pg/extend-reporter.sql b/Open-ILS/src/sql/Pg/extend-reporter.sql index 1f8eaf8e24..ccc16de55a 100644 --- a/Open-ILS/src/sql/Pg/extend-reporter.sql +++ b/Open-ILS/src/sql/Pg/extend-reporter.sql @@ -33,7 +33,7 @@ CREATE OR REPLACE VIEW extend_reporter.full_circ_count AS GROUP BY cp.id; CREATE OR REPLACE VIEW extend_reporter.global_bibs_by_holding_update AS - SELECT id, LAST(holding_update) AS holding_update, update_type + SELECT DISTINCT ON (id) id, holding_update, update_type FROM (SELECT b.id, LAST(cp.create_date) AS holding_update, 'add' AS update_type @@ -53,7 +53,7 @@ CREATE OR REPLACE VIEW extend_reporter.global_bibs_by_holding_update AS WHERE cp.deleted AND b.id > 0 GROUP BY b.id)x - GROUP BY id, update_type; + ORDER BY id, holding_update; COMMIT; -- 2.11.0