From: miker Date: Wed, 18 Jun 2008 19:58:18 +0000 (+0000) Subject: fixing reporter extention example X-Git-Url: https://git.evergreen-ils.org/?p=Evergreen.git;a=commitdiff_plain;h=6bdd4b882a4292aca4cc2f3dac3652eb3feb34b5 fixing reporter extention example git-svn-id: svn://svn.open-ils.org/ILS/trunk@9850 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/sql/Pg/extend-reporter.sql b/Open-ILS/src/sql/Pg/extend-reporter.sql index 90fcd2d032..d03f9db974 100644 --- a/Open-ILS/src/sql/Pg/extend-reporter.sql +++ b/Open-ILS/src/sql/Pg/extend-reporter.sql @@ -21,7 +21,7 @@ BEGIN; CREATE SCHEMA extend_reporter; CREATE TABLE extend_reporter.legcay_circ_count ( - id BIGSERIAL PRIMARY KEY REFERENCES asset.copy (id) + id BIGSERIAL PRIMARY KEY REFERENCES asset.copy (id), circ_count INT NOT NULL DEFAULT 0 ); @@ -29,7 +29,7 @@ CREATE VIEW extend_reporter.full_circ_count AS SELECT cp.id, COALESCE(sum(c.circ_count), 0::bigint) + COALESCE(count(circ.id), 0::bigint) AS circ_count FROM asset."copy" cp LEFT JOIN extend_reporter.legcay_circ_count c USING (id) - LEFT JOIN "action".circulation circ ON circ.target_copy = c.id + LEFT JOIN "action".all_circulation circ ON circ.target_copy = c.id GROUP BY cp.id; COMMIT;