Skip to content

Instantly share code, notes, and snippets.

@sandbergja
Last active April 28, 2016 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandbergja/e2517cca3bb36caca1803c96e51eaa95 to your computer and use it in GitHub Desktop.
Save sandbergja/e2517cca3bb36caca1803c96e51eaa95 to your computer and use it in GitHub Desktop.
ACRL circ stats
SELECT COUNT(circ.id) AS renewal
FROM action.circulation circ, asset.copy c, asset.call_number cn, metabib.rec_descriptor mb
WHERE xact_start > '2014-07-01' AND xact_start< '2015-07-01'
AND circ.circ_lib=7
AND (opac_renewal OR phone_renewal OR desk_renewal)
AND copy_location != 229 AND copy_location != 238
AND circ.target_copy=c.id AND c.call_number=cn.id AND mb.record=cn.record
AND mb.item_type != 'r';
SELECT COUNT(circ.id) AS circ
FROM action.circulation circ, asset.copy c, asset.call_number cn, metabib.rec_descriptor mb
WHERE xact_start > '2014-07-01' AND xact_start< '2015-07-01'
AND circ.circ_lib=7
AND NOT opac_renewal AND NOT phone_renewal AND NOT desk_renewal
AND copy_location != 229 AND copy_location != 238
AND circ.target_copy=c.id AND c.call_number=cn.id AND mb.record=cn.record
AND mb.item_type != 'r';
SELECT COUNT(id) AS reserves
FROM action.circulation
WHERE xact_start > '2014-07-01' AND xact_start< '2015-07-01'
AND circ_lib=7
AND copy_location = 229;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment