Hi all,

I've been pondering how to do this report, but haven't found a good solution:

I'd like to have a list of all subfield values for certain subfield from 
biblioitems, and have counts of the field contents.

For example:

SELECT
   count(*),
   ExtractValue(marcxml, 
'//datafield[@tag=<<Field>>]/subfield[@code="<<Subfield>>"]') AS kentta
FROM biblioitems
GROUP BY kentta
ORDER BY count(*), kentta

This works, except when the field or subfield is repeatable, because the values 
from a single record are concatenated by MySQL, with the values separated by 
spaces. This means it's impossible to know if the space is a separator between 
the field values, or part of a field value.

(If only Koha stored the marcxml data in a database-query friendly format 
too...)

--
Ystävällisin terveisin

Pasi Kallinen
ICT-asiantuntija

p. 050-408 6958
pasi.kalli...@pttk.fi


Pohjois-Karjalan Tietotekniikkakeskus Oy - www.pttk.fi
_______________________________________________
Koha mailing list  http://koha-community.org
Koha@lists.katipo.co.nz
https://lists.katipo.co.nz/mailman/listinfo/koha

Reply via email to