I'd say you are missing a group by. On Mon, 23 Apr 2018 at 10:19 Cab Vinton <[email protected]> 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 > [email protected] > https://lists.katipo.co.nz/mailman/listinfo/koha > _______________________________________________ Koha mailing list http://koha-community.org [email protected] https://lists.katipo.co.nz/mailman/listinfo/koha

