From 5faf1de82a5ec6520cf2328585146e379cbff8e4 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Wed, 24 Jul 2019 09:16:07 -0400 Subject: [PATCH] moving most recent circ from action.circulation to all_circulation --- collectionHQ/functions.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collectionHQ/functions.sql b/collectionHQ/functions.sql index 3513762..a181121 100644 --- a/collectionHQ/functions.sql +++ b/collectionHQ/functions.sql @@ -141,7 +141,7 @@ CREATE OR REPLACE FUNCTION collectionHQ.write_item_rows_to_stdout (TEXT, INT) RE END IF; SELECT REPLACE(NOW()::DATE::TEXT, '-', '') INTO extract_date; SELECT ou.shortname INTO library_code FROM actor.org_unit ou, asset.copy c WHERE ou.id = c.circ_lib AND c.id = item; - SELECT aou.shortname, REPLACE(circ.xact_start::DATE::TEXT, '-', '') INTO last_circ_lib, last_use_date FROM actor.org_unit aou INNER JOIN action.circulation circ ON (circ.circ_lib = aou.id) + SELECT aou.shortname, REPLACE(circ.xact_start::DATE::TEXT, '-', '') INTO last_circ_lib, last_use_date FROM actor.org_unit aou INNER JOIN action.all_circulation circ ON (circ.circ_lib = aou.id) WHERE circ.target_copy = item ORDER BY circ.xact_start DESC LIMIT 1; SELECT REPLACE(xact_start::DATE::TEXT, '-', '') INTO last_use_date FROM action.circulation WHERE target_copy = item ORDER BY xact_start DESC LIMIT 1; SELECT circ_count INTO cumulative_use_total FROM extend_reporter.full_circ_count WHERE id = item; -- 2.11.0