Created
July 13, 2016 15:44
-
-
Save stompro/2b2e96dc1b9907193c83469cc3222edc to your computer and use it in GitHub Desktop.
Report Copy Status by circ lib evergreen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- List counts of copy statuses by circ lib | |
select aou.shortname,cs.name as status,count(ac.id),now() | |
from asset.copy ac | |
join config.copy_status cs on (ac.status=cs.id) | |
join actor.org_unit aou on aou.id=ac.circ_lib | |
where ac.deleted=false | |
-- and ac.circ_lib in (SELECT id FROM actor.org_unit_descendants(127)) | |
group by aou.shortname,cs.name | |
order by aou.shortname,cs.name | |
; | |
-- list counts of copy statuses by circ lib and circ_mod | |
select aou.shortname,ac.circ_modifier, cs.name as status,count(ac.id),now() | |
from asset.copy ac | |
join config.copy_status cs on (ac.status=cs.id) | |
join actor.org_unit aou on aou.id=ac.circ_lib | |
where ac.deleted=false | |
-- and ac.circ_lib in (SELECT id FROM actor.org_unit_descendants(127)) | |
group by aou.parent_ou,aou.shortname,ac.circ_modifier,cs.name | |
order by aou.parent_ou,aou.shortname,ac.circ_modifier,cs.name | |
; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment