[Koha] SQL help please

Kerrie Stevens KStevens at harvest.edu.au
Thu Apr 13 11:30:00 NZST 2017


Thanks Katrin – I think that has worked!
Thank you for your help.

Kerrie Stevens

From: Katrin [mailto:katrin.fischer.83 at web.de]
Sent: Thursday, April 13, 2017 8:36 AM
To: Kerrie Stevens <KStevens at harvest.edu.au>
Cc: koha at lists.katipo.co.nz
Subject: Re: [Koha] SQL help please


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