[open-ils-commits] r11525 - trunk/Open-ILS/src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Dec 11 14:26:11 EST 2008
Author: miker
Date: 2008-12-11 14:26:08 -0500 (Thu, 11 Dec 2008)
New Revision: 11525
Modified:
trunk/Open-ILS/src/sql/Pg/extend-reporter.sql
Log:
logic fix to new bibs-by-holdings-change view
Modified: trunk/Open-ILS/src/sql/Pg/extend-reporter.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/extend-reporter.sql 2008-12-11 16:39:47 UTC (rev 11524)
+++ trunk/Open-ILS/src/sql/Pg/extend-reporter.sql 2008-12-11 19:26:08 UTC (rev 11525)
@@ -33,7 +33,7 @@
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 @@
WHERE cp.deleted
AND b.id > 0
GROUP BY b.id)x
- GROUP BY id, update_type;
+ ORDER BY id, holding_update;
COMMIT;
More information about the open-ils-commits
mailing list