[Koha] Question about SQL query

Lenora Oftedahl oftl at critfc.org
Thu Mar 24 10:10:44 NZDT 2016


SELECT biblio.biblionumber, SUBSTRING(biblioitems.marcxml, LOCATE('<subfield code="a">', 
	   biblioitems.marcxml, LOCATE('<datafield tag="029"', biblioitems.marcxml)+19), 
	   LOCATE('</subfield>', biblioitems.marcxml, LOCATE('<subfield code="a">', 
	   biblioitems.marcxml, LOCATE('<datafield tag="029"', 
	   biblioitems.marcxml)+19)) - LOCATE('<subfield code="a">', biblioitems.marcxml, 
	   LOCATE('<datafield tag="029"', biblioitems.marcxml)+19)) AS SNRefID 
FROM biblioitems, biblio 
WHERE biblioitems.biblionumber = biblio.biblionumber
In this SQL query, what does the +19 do?  
 
I'm trying to write a report to pull out all the catalog records for a select group of documents by 029 subfield A.  I think my current results are from the 035 A subfield which is not what I'm asking for.
 


More information about the Koha mailing list