Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT aac_copy_owning_lib."shortname" AS "Owning Library",
- aac_target_copy_call_number."label" AS "Call Number",
- rmsr."title" AS "Title",
- COUNT(aac."id") AS "Circ Count"
- FROM action.all_circulation AS aac
- INNER JOIN actor.org_unit AS aac_copy_owning_lib ON (aac."copy_owning_lib" = aac_copy_owning_lib."id")
- INNER JOIN biblio.record_entry AS aac_copy_bib_record ON (aac."copy_bib_record" = aac_copy_bib_record."id")
- INNER JOIN metabib.rec_descriptor AS mrd ON (aac_copy_bib_record."id" = mrd."record")
- INNER JOIN config.item_type_map AS citm ON (mrd."item_type" = citm."code")
- INNER JOIN config.item_form_map AS cifm ON (mrd."item_form" = cifm."code")
- INNER JOIN reporter.materialized_simple_record AS rmsr ON (aac_copy_bib_record."id" = rmsr."id")
- INNER JOIN asset.copy AS aac_target_copy ON (aac."target_copy" = aac_target_copy."id")
- INNER JOIN asset.call_number AS aac_target_copy_call_number ON (aac_target_copy."call_number" = aac_target_copy_call_number."id")
- WHERE aac_copy_owning_lib."id" IN ('156','157','158','159','160','161','351','162')
- AND citm."code" = 'i'
- AND cifm."code" = 'q'
- GROUP BY 1, 2, 3
- ORDER BY aac_copy_owning_lib."shortname" ASC, aac_target_copy_call_number."label" ASC, rmsr."title" ASC, COUNT(aac."id") ASC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement