Unfortunately, that's just the way that ExtractValue works. From the manual:<br><br>If multiple matches are found, the content of the first child
text node of each matching element is returned (in the order
matched) as a single, space-delimited string.
<br><br>Since MARC doesn't give us any means of differentiating between the multiple fields aside from their order, there isn't much that can be done here. And if the desired 610 field isn't the first in the series of them, the LIKE clause won't match; you'd need % in front, as well.<br>
<br>MARC for the fail.. :(<br><br><br>-Ian<br><br><div class="gmail_quote">2011/7/1 Chris Nighswonger <span dir="ltr"><<a href="mailto:cnighswonger@foundations.edu">cnighswonger@foundations.edu</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Nicole,<div class="im"><br><br><div class="gmail_quote">On Fri, Jul 1, 2011 at 9:33 AM, Nicole Engard <span dir="ltr"><<a href="mailto:nengard@gmail.com" target="_blank">nengard@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi all,<br>
<br>
I wrote this report to get all subject headings in a Koha system that<br>
start with key phrases:<br>
<br>
SELECT lcsh<br>
FROM<br>
(SELECT biblionumber,<br>
ExtractValue(marcxml,'//datafield[@tag="610"]/subfield[@code>="a"]')<br>
AS lcsh FROM biblioitems)<br>
AS subjects<br>
WHERE lcsh<br>
LIKE "College%"<br>
OR lcsh LIKE "Seminary%"<br>
GROUP BY lcsh<br>
<br>
<br>
What's happening is if there is more than one 610 on a bib record it's<br>
showing them both on one line. I tried using DISTINCT, but that's<br>
didn't do the trick, so I'm up for ideas.<br></blockquote></div><br></div>I did some work with ExtractValue and marcxml a while back and IIRC this has to do with the way ExtractValue returns the data from the xml. I was unable to find a workaround at the time, but perhaps someone else has found one.<br>
<br>Kind Regards,<br><font color="#888888">Chris<br>
</font><br>_______________________________________________<br>
Koha mailing list <a href="http://koha-community.org" target="_blank">http://koha-community.org</a><br>
<a href="mailto:Koha@lists.katipo.co.nz">Koha@lists.katipo.co.nz</a><br>
<a href="http://lists.katipo.co.nz/mailman/listinfo/koha" target="_blank">http://lists.katipo.co.nz/mailman/listinfo/koha</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Ian Walls<br>Lead Development Specialist<br>ByWater Solutions<br>ALA Booth 732<br>Phone # (888) 900-8944<br><a href="http://bywatersolutions.com" target="_blank">http://bywatersolutions.com</a><br>
<a href="mailto:ian.walls@bywatersolutions.com" target="_blank">ian.walls@bywatersolutions.com</a><br>Twitter: @sekjal<br>