Hi Katrin, Again, this is giving me everything at QLD, not items ONLY held at QLD…
I’m sure there must be a way to do it… Thanks, Kerrie Stevens From: Katrin Fischer [mailto:[email protected]] Sent: Wednesday, April 12, 2017 5:27 PM To: Kerrie Stevens <[email protected]> Cc: [email protected] Subject: Aw: [Koha] SQL help please Hi Kerrie, I think DISTINCT is not quite what you want here, but this seems to work for one of our libraries with multiple branches: SELECT i.itemnumber, b.title, b.author, i.itemcallnumber, i.barcode, i.homebranch FROM items i LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber) WHERE homebranch = "QLD" AND i.biblionumber not in (SELECT biblionumber FROM items WHERE i.homebranch != "QLD") ORDER BY i.itemcallnumber Hope this helps, Katrin Gesendet: Mittwoch, 12. April 2017 um 07:20 Uhr Von: "Kerrie Stevens" <[email protected]<mailto:[email protected]>> An: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Betreff: [Koha] SQL help please I have this report that lists all the items in our QLD library but I want to restrict it to items ONLY held in our QLD library and not another branch... I don't know where to put the DISTINCT tag? Please advise: SELECT items.itemnumber, biblio.title, biblio.author, items.itemcallnumber, items.barcode FROM items LEFT JOIN biblio ON (items.biblionumber=biblio.biblionumber) WHERE items.homebranch='QLD' ORDER BY items.itemcallnumber Thanks for your help, Kerrie Stevens Harevst Bible College _______________________________________________ Koha mailing list http://koha-community.org [email protected]<mailto:[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

