[Koha] Items held by more than one branch

Cab Vinton bibliwho at gmail.com
Tue Apr 24 01:19:10 NZST 2018


Hi, all--

Another report question...

Trying to write a report that will provide details for items held by
more than one branch, with separate output for each library's item.

Including the statement HAVING COUNT(i.itemnumber) > 1 collapses the
results to just one title. (Strangely, the bib returned only has a
single item attached.)

I'm missing some basic feature of how SQL operates :-(

SELECT b.biblionumber,i.homebranch,t.isbn,b.title,b.author,i.ccode,i.itype
FROM items i
LEFT JOIN biblio b USING (biblionumber)
LEFT JOIN biblioitems t USING (biblionumber)
WHERE i.itemlost=0 AND i.withdrawn=0
HAVING COUNT(i.itemnumber) > 1
ORDER BY b.title

Grateful in advance for any assistance!

All best,

Cab Vinton
Plaistow Public Library
Plaistow, NH


More information about the Koha mailing list