Last active
August 29, 2015 14:27
-
-
Save sandbergja/32262201df345f7b5cca to your computer and use it in GitHub Desktop.
series problem (490 w/o 830)
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
SELECT DISTINCT b.id as tcn, ou.name as library, cn.label as call_number, c.barcode, xpath('//m:datafield[@tag="245"]/m:subfield[@code="a"]/text()', b.marc::xml, ARRAY[ARRAY['m','http://www.loc.gov/MARC21/slim']])::VARCHAR as title | |
FROM biblio.record_entry b | |
INNER JOIN asset.call_number cn ON cn.record=b.id | |
INNER JOIN asset.copy c ON c.call_number=cn.id | |
INNER JOIN actor.org_unit ou on ou.id=c.circ_lib | |
WHERE b.deleted=FALSE | |
AND b.id != -1 | |
AND xpath_exists('//m:datafield[@tag="490" and @ind1="1"]', b.marc::xml, ARRAY[ARRAY['m','http://www.loc.gov/MARC21/slim']]) | |
AND marc NOT LIKE '%tag="800%' | |
AND marc NOT LIKE '%tag="810%' | |
AND marc NOT LIKE '%tag="811%' | |
AND marc NOT LIKE '%tag="830%' | |
AND c.circ_lib=7 | |
ORDER BY library; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment