[Koha] Report help needed 999$c

Robin Sheat robin at catalyst.net.nz
Tue May 6 10:57:29 NZST 2014


Elaine Bradtke schreef op ma 05-05-2014 om 22:55 [+0100]:
>  I've got something that extracts the biblio numbers from the 999c. Is
> there any way to ask it to only show the ones that contain multiple 999c?
> 
> 
> SELECT biblionumber, ExtractValue(marcxml,
> '//datafield[@tag="999"]/subfield[@code="c"]') AS comp FROM
> biblioitems

This is totally untested, but you might be able to use the XPath count()
function in your ExtractValue. So,:

ExtractValue(marcxml, 'count(//datafield[@tag="999"]/subfield[@code="c"])')

An example here:

http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html#function_extractvalue

Note that it looked like your data also had multiple entries in one 999
$c field, separated with '|'. That's weird, and this won't find that. On
the other hand, you can just do "WHERE field LIKE "%|%"" to catch those.

-- 
Robin Sheat
Catalyst IT Ltd.
✆ +64 4 803 2204
GPG: 5FA7 4B49 1E4D CAA4 4C38  8505 77F5 B724 F871 3BDF



More information about the Koha mailing list