home / current_collection

item_view (view)

0 rows where location_code = "1cjro"

✎ View and edit SQL

This data as json

0 records

CREATE VIEW item_view AS select
  item.item_record_num,
  item.volume_record_num,
  item.bib_record_num,
  item.creation_date,
  item.barcode,
  item.item_format,
  item.location_code,
  location_name."name" as location_name,
  branch_name."name" as branch_name,
  item.item_callnumber,
  item.volume_record_statement as vol_statement,
  bib.best_author,
  bib.best_title,
  item.agency_code_num,
  item.item_status_code,
  item_status_property.item_status_name,
  coalesce(
    item.checkout_date,
    item.last_checkin_date,
    item.last_checkout_date
  ) as last_circ_act_date,
  item.checkout_date,
  item.due_date,
  item.checkout_total,
  item.renewal_total,
  item.price_cents / 100.0 as item_price,
  bib.publish_year
from
  item
  left outer join bib on bib.bib_record_num = item.bib_record_num
  left outer join location on location.code = item.location_code
  left outer join location_name on location_name.location_id = location.id
  left outer join branch on branch.code_num = location.branch_code_num
  left outer join branch_name on branch_name.branch_id = branch.id
  left outer join item_status_property on item_status_property.item_status_code = item.item_status_code;
Powered by Datasette · Queries took 309.323ms