[Koha] Report Help - Extracting XML

Daniel Grobani dgrobani at samuelmerritt.edu
Fri Jul 29 11:41:29 NZST 2011


Try this (I also did some light cleanup):

SELECT		COUNT(statistics.datetime) AS circs,
		CONCAT(' \"/cgi- ',biblio.title,' ') AS Title,
		CONCAT(' \"http://mycatalogv/cgi-
http://catalog.losgatosca.gov/cgi-bin/koha/opac-detail.pl?biblionumber=',biblio.biblionumber,'
') AS URL,
		biblio.author,
		items.location,
	
extractValue(biblioitems.marcxml,"collection/record/datafield[@tag='520'][1]/subfield[@code='a']")
FROM		statistics
JOIN		items ON (items.itemnumber=statistics.itemnumber)
LEFT JOIN	biblio ON (biblio.biblionumber=items.biblionumber)
LEFT JOIN	biblioitems ON (biblioitems.biblioitemnumber =
items.biblioitemnumber)
WHERE		DATE(statistics.datetime) BETWEEN 'yyyy-mm-dd' AND 'yyyy-mm-dd'
			AND statistics.itemnumber IS NOT NULL
			AND location = 'Shelving Location Code'
GROUP BY	biblio.biblionumber
ORDER BY	circs DESC
LIMIT		10


-----
Cheers,
Daniel Grobani
Library Technology Specialist
John A. Graziano Memorial Library
Samuel Merritt University

--
View this message in context: http://koha.1045719.n5.nabble.com/Report-Help-Extracting-XML-tp4640604p4644634.html
Sent from the Koha - Discuss mailing list archive at Nabble.com.


More information about the Koha mailing list