sql query / number of items
Hi, I need to write a sql query to count the number of 995 field in the records which i 've imported. An idea? Best, samuel
Samuel Desseaux <samuel.desseaux@ecp.fr>
I need to write a sql query to count the number of 995 field in the records which i 've imported.
An idea?
Firstly, this is a use query, not a development one, so should be sent to koha@lists.katipo.co.nz and not koha-devel. Secondly, it's probably quite similar to http://wiki.koha-community.org/wiki/SQL_Reports_Library#Duplicate_bibs_using... but using 995 instead of 001 and count(...) somewhere. Hope that helps, -- MJ Ray (slef), member of www.software.coop, a for-more-than-profit co-op. http://koha-community.org supporter, web and library systems developer. In My Opinion Only: see http://mjr.towers.org.uk/email.html Available for hire (including development) at http://www.software.coop/
Hi Samuel, Try this query which assumes that the 955 data is in subfield a: SELECT COUNT(biblioitems.biblioitemnumber) as '955 tag' FROM biblioitems WHERE ExtractValue(biblioitems.marcxml, '//datafield[@tag="955"]/subfield[@code="a"]') > 0 The query counts all 955 tags. It can be modified to count 955 tags in records added on a specific date or date range. As a test, you may want to first run this query which selects 5 records with the 955 tag so you can check the biblio records in cataloging: SELECT biblio.biblionumber, biblio.title, ExtractValue(biblioitems.marcxml, '//datafield[@tag="955"]/subfield[@code="a"]') as '955 tag' FROM biblioitems, biblio WHERE biblioitems.biblionumber = biblio.biblionumber AND ExtractValue(biblioitems.marcxml, '//datafield[@tag="955"]/subfield[@code="a"]') > 0 LIMIT 5 Bev On Thu, Jan 17, 2013 at 6:27 AM, Samuel Desseaux <samuel.desseaux@ecp.fr>wrote:
Hi,
I need to write a sql query to count the number of 995 field in the records which i 've imported.
An idea?
Best,
samuel
_______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
-- Customer Support e-Libris Technologies, LLC email: elibris.helpdesk@gmail.com <elibrishelpdesk@gmail.com> phone: 1-877-723-9447 ext. 2
participants (3)
-
e-Libris Helpdesk -
MJ Ray -
Samuel Desseaux