Skip to content

Instantly share code, notes, and snippets.

@sandbergja
Created May 3, 2016 21:32
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/466eabb7a0181a534d2f8ac13269845c to your computer and use it in GitHub Desktop.
Save sandbergja/466eabb7a0181a534d2f8ac13269845c to your computer and use it in GitHub Desktop.
Count of items that LBCC patrons can request via resource sharing
SELECT COUNT(c.id) FROM asset.copy c
WHERE
c.circ_modifier NOT IN (SELECT DISTINCT h.circ_modifier FROM config.hold_matrix_matchpoint h WHERE h.circ_modifier IS NOT NULL AND (h.user_home_ou=8 OR h.user_home_ou=1) AND h.active AND NOT h.holdable)
AND NOT c.deleted
AND c.circ_lib !=7
AND c.circ_lib !=6 -- LPL
AND c.status != 2 -- Bindery
AND c.status != 3 -- Lost
AND c.status != 4 -- Missing
AND c.status != 10 -- ILL
AND c.status != 16 -- Long overdue
AND c.status != 103 -- Stolen
AND c.status != 17 -- Lost and paid
AND c.holdable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment