Stockholms universitetsbibliotek

Från Svenska kohanätverkets wiki
Hoppa till navigering Hoppa till sök

Circulation

Antal lån via utlåningsmaskin

SELECT COUNT(s.itemnumber) AS antal
FROM statistics s
LEFT JOIN action_logs a ON (s.itemnumber=a.object AND s.datetime=a.timestamp)
WHERE s.branch = <<Välj enhet|branches>>
AND s.`type` = 'issue'
AND a.user = <<Skriv borrower id för utlåningsmaskin>>
AND date(datetime) BETWEEN <<Startdatum|date>>
AND <<Slutdatum|date>>

In Transit Material som ej kommit fram till sin enhet med tillägg homebranch och itemcallnumber

SELECT frombranch, barcode, title, author, homebranch, holdingbranch, itemcallnumber, monthname(datesent) month,COUNT(*) 
FROM branchtransfers bt,
  items i,
  biblio b
WHERE bt.itemnumber = i.itemnumber
AND i.biblionumber = b.biblionumber
AND datesent >= concat(date_format(LAST_DAY(now() - interval 7 month),'%m-'),'01')
AND datesent <= LAST_DAY(now() - interval 2 month)
AND datearrived IS NULL
GROUP BY month, barcode, title, author, homebranch, itemcallnumber



Samlingar

Bestånd utifrån DDK-klassifikation i den bibliografiska posten (fält 082) på vald enhet (homebranch), location

SELECT
i.itemcallnumber,
b.author,
b.title,
i.barcode,
ExtractValue (bm.metadata,'//datafield[@tag="035"]/subfield[@code="a" and contains(text(), "LIBRIS")]') AS 'LibrisID',
ExtractValue(bm.metadata, '//datafield[@tag="082"]/subfield[@code="a"]') AS 'Dewey',
ExtractValue(bm.metadata, '//datafield[@tag="084"]/subfield[@code="a"]') AS 'SAB',
b.copyrightdate,
i.itype AS 'Item type',
i.onloan AS 'Utlånad',
i.itemlost,
i.homebranch,
i.location,
b.biblionumber,
i.itemnumber
FROM items i
LEFT JOIN biblio_metadata bm ON (i.biblionumber=bm.biblionumber)
LEFT JOIN biblio b ON (bm.biblionumber=b.biblionumber)
WHERE i.homebranch = <<Välj enhet|branches>> 
AND i.location = <<Välj location|LOC>>
AND ExtractValue(bm.metadata, '//datafield[@tag="082"]/subfield[@code="a"]') LIKE <<Skriv början på Deweykod ex 839%>>
ORDER BY i.itemcallnumber