[Koha] Items held by more than one branch

Jonathan Druart jonathan.druart at bugs.koha-community.org
Tue Apr 24 02:14:35 NZST 2018


I'd say you are missing a group by.

On Mon, 23 Apr 2018 at 10:19 Cab Vinton <bibliwho at gmail.com> wrote:

> 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
> _______________________________________________
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> https://lists.katipo.co.nz/mailman/listinfo/koha
>


More information about the Koha mailing list