Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Right now DCL just wants their own materials. Also include non-copy holding records that have 856s that have their designator.
- In the future it could have holdable materials by other library systems. For that check to see if they are holdable and outside age protection. But, that'll be after the new year.
- */
- select distinct bre.id
- from asset.copy ac
- join asset.call_number acn on acn.id = ac.call_number
- join biblio.record_entry bre on bre.id = acn.record
- join actor.org_unit aou on aou.id = ac.circ_lib
- join config.bib_source b on b.id = bre.source
- where aou.shortname ilike 'dcl%' and ac.deleted = false and bre.deleted = false and b.can_have_copies = true
- UNION ALL
- select distinct bre.id
- from biblio.record_entry bre
- join metabib.real_full_rec rfr on rfr.record = bre.id
- join config.bib_source b on b.id = bre.source
- where rfr.subfield = '9' and rfr.tag = '856' and rfr.value ilike 'dcl' and b.can_have_copies = false
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement