[Koha] sql report for bibliographic records with more than one subject

schnydszch eugenegf at yahoo.com
Tue Sep 23 03:28:05 NZST 2014


Hi all! Im trying to make a report that will have in one column all subjects
of the bibliographic record separated by a 'semicolon', so it can be saved
as csv file. I'm trying the following: 

SELECT ExtractValue(marcxml,'//datafield[@tag="245"]/subfield[@code="a"]')
AS TITLE,
ExtractValue(marcxml,'//datafield[@tag="245"]/subfield[@code="b"]') AS
TITLE2, ExtractValue(marcxml,'//datafield[@tag="246"]/subfield[@code="a"]')
AS
TITLE3,ExtractValue(marcxml,'//datafield[@tag="245"]/subfield[@code="c"]')
AS AUTHOR,
ExtractValue(marcxml,'//datafield[@tag="581"]/subfield[@code="a"]') AS
Source, ExtractValue(marcxml,'//datafield[@tag="590"]/subfield[@code="a"]')
AS Date_Approved,
ExtractValue(marcxml,'//datafield[@tag="653"]/subfield[@code="a"]') AS
Subjects FROM biblioitems LEFT JOIN biblio on
(biblioitems.biblionumber=biblio.biblionumber) WHERE
biblioitems.itemtype='LAWS' ORDER BY biblio.title asc

However, with this query it puts in one column all subjects separated by
space. I'm trying out group_concat with separator, but still to no avail.
Anybody in the group who had the same query? Thanks in advance and cheers!



--
View this message in context: http://koha.1045719.n5.nabble.com/sql-report-for-bibliographic-records-with-more-than-one-subject-tp5812484.html
Sent from the Koha-general mailing list archive at Nabble.com.


More information about the Koha mailing list