Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select * from biblio.record_entry where fingerprint ilike '%american%' and fingerprint ilike '%sniper%';
- SELECT ahr.id, ahr.request_time, ahr.capture_time, ahr.fulfillment_time, ahr.cancel_time,
- ahr.current_copy, aou.shortname as pickup_lib, ahr.usr FROM ACTION.hold_request ahr
- JOIN (
- SELECT bre.id, 'T' AS hold_type FROM biblio.record_entry bre WHERE bre.id = 2686225
- UNION ALL
- SELECT acn.id, 'V' AS hold_type FROM asset.call_number acn JOIN biblio.record_entry bre ON bre.id = acn.record
- JOIN actor.org_unit aou ON aou.id = acn.owning_lib WHERE aou.shortname ILIKE 'DCL%' AND bre.id = 2686225
- UNION ALL
- SELECT ac.id, 'C' AS hold_type 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 = acn.owning_lib
- WHERE aou.shortname ILIKE 'DCL%' AND bre.id = 2686225
- UNION ALL
- SELECT mm.id, 'M' AS hold_type FROM metabib.metarecord mm
- JOIN biblio.record_entry bre ON bre.fingerprint = mm.fingerprint WHERE bre.id = 2686225
- ) holds ON holds.id = ahr.target
- JOIN actor.org_unit aou ON aou.id = ahr.pickup_lib
- WHERE holds.hold_type = ahr.hold_type AND aou.shortname ILIKE 'DCL%'
- AND ahr.target = 2686225 AND ahr.hold_type = 'T' ORDER BY ahr.request_time;
- /*
- SELECT acirc.id, acirc.usr, acirc.xact_start, acirc.xact_finish, acirc.unrecovered, acirc.target_copy,
- aou.shortname as circ_lib, aou2.shortname as checkin_lib, acirc.due_date, acirc.stop_fines_time,
- acirc.checkin_time, acirc.create_time
- FROM action.circulation acirc
- JOIN actor.org_unit aou ON aou.id = acirc.circ_lib
- JOIN actor.org_unit aou2 on aou2.id = acirc.checkin_lib
- JOIN asset.COPY ac ON ac.id = acirc.target_copy
- JOIN asset.call_number acn ON acn.id = ac.call_number
- WHERE aou.shortname ILIKE 'DCL%' AND acn.record = 2686225 ORDER BY xact_start;
- */
- SELECT ac.id as copy_id, aou.shortname as circ_lib, ac.create_date, ccs.name as status, ac.active_date
- FROM asset.COPY ac
- JOIN asset.call_number acn ON acn.id = ac.call_number
- JOIN actor.org_unit aou ON aou.id = ac.circ_lib
- JOIN config.copy_status ccs on ccs.id = ac.status
- WHERE acn.record = 2686225 AND aou.shortname ILIKE 'DCL%'
- ;
- /*
- SELECT ac.id as copy_id, ac.audit_time, ac.audit_action,
- aou.shortname as circ_lib, ac.create_date, ccs.name as status, ac.active_date
- FROM auditor.asset_copy_history ac
- JOIN asset.call_number acn ON acn.id = ac.call_number
- JOIN actor.org_unit aou ON aou.id = ac.circ_lib
- JOIN config.copy_status ccs on ccs.id = ac.status
- WHERE acn.record = 2686225 AND aou.shortname ILIKE 'DCL%'
- order by 1, 2 desc
- ;
- */
- select acirc.xact_start, acirc.xact_finish, acirc.unrecovered, acirc.target_copy,
- aou.shortname as circ_lib, aou2.shortname as checkin_lib from action.circulation acirc
- join actor.org_unit aou on aou.id = acirc.circ_lib
- join actor.org_unit aou2 on aou2.id = acirc.checkin_lib
- where target_copy = 5157639 order by acirc.id desc;
- select * from actor.org_unit where shortname ilike 'dcl%';
- select * from auditor.actor_usr_history where id = 2242297 order by audit_id desc;
- select * from money.billable_xact_summary where usr = 2242297;
- select * from action.hold_request where
- date(request_time) <= '2015-08-31' and date(fulfillment_time) >= '2015-08-31' and usr = 2242297;
- select * from actor.card where usr = 2242297;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement