[Koha] A report for finding records with multiple items?

Roberts, David david.roberts at ptfs-europe.com
Fri Feb 6 13:17:56 NZDT 2015


I haven't actually tried this, but there is a report in the Koha SQL
Reports library that looks like it can be adapted to do what you want. The
report is called "Records with item count". I reckon you just need to add a
'HAVING' clause which identifies records with more than one copy:

*SELECT DISTINCT
 CONCAT('<a title="Search for all records sharing the
title:',b.title,'" href="/cgi-bin/koha/catalogue/search.pl?q=ti%3A
<http://search.pl?q=ti%3A>',
 REPLACE(REPLACE (b.title, ' ', '+'),'?',''),'">Search</a>') AS
"Search for Title",
 b.biblionumber,
 CONCAT('<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=
<http://detail.pl?biblionumber=>',b.biblionumber,'">',b.title,'</a>')
AS "Item Title",
 b.author,
 t.editionstatement,
 t.publishercode,
 t.isbn,
 count(i.biblionumber) AS "Copies"
FROM biblio b
LEFT JOIN biblioitems t USING(biblionumber)
LEFT JOIN items i USING(biblionumber)
GROUP BY b.biblionumber
HAVING copies > 1
ORDER BY Copies ASC*


Like I say, I haven't tested it, but I think it should work. Somebody else
may have a better way.

Cheers

David


> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 05 Feb 2015 21:17:40 +0100
> From: "andrea.furin at slacky.it" <andrea.furin at slacky.it>
> To: "koha at lists.katipo.co.nz" <koha at lists.katipo.co.nz>
> Subject: [Koha] A report for finding records with multiple items?
> Message-ID: <54D3CFE4.3060107 at slacky.it>
> Content-Type: text/plain; charset=windows-1252
>
> Hi.
> I'd need to write a report for finding records with multiple items in
> them: any suggestions?
> TIA
>
> Andrea Furin
>
>
> ------------------------------
>

-- 
David Roberts
Customer Support Consultant.
PTFS Europe Ltd.
david.roberts at ptfs-europe.com
Skype: david.roberts.2

http://www.ptfs-europe.com
<http://t.sigopn04.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJN7t5XX4QBdV-N3MyblvcW5ggVd76_W56dGPkf7SXhKs02?t=http%3A%2F%2Fwww.ptfs-europe.com%2F&si=4884665740034048&pi=a94240f2-184a-4f0b-da6b-c66d57fd7536>


More information about the Koha mailing list