[Koha] SQL help please

Katrin katrin.fischer.83 at web.de
Thu Apr 13 10:36:24 NZST 2017


Hi Kerry,

you are right, I think this one should be better:

SELECT
i.itemnumber,
i.biblionumber,
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 distinct i2.biblionumber from items i2 
where homebranch != "QLD")
ORDER BY i.itemcallnumber

If you want holdingbranch instead of holdingbranch you can just replace it.

Hope this works,

Katrin


On 12.04.2017 23:52, Kerrie Stevens wrote:
>
> 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
>



More information about the Koha mailing list