[Koha] SQL help please

Mark Alexander marka at pobox.com
Tue Dec 12 05:36:21 NZDT 2017


Excerpts from Pedro Amorim's message of 2017-12-11 14:18:08 -0100:
> This should work:
> 
> Select title, author, i.itemcallnumber from biblio b
> Left join biblioitems bi on b.biblionumber=bi.biblionumber
> Left join items i on bi.biblionumber=i.biblionumber
> where i.barcode IN ("BARCODE1", "BARCODE2", "BARCODE3");

This can also be made into an SQL report using multiple entry fields
for the barcodes.  It's a bit of a kludge but seems to work because
the blank fields are treated either as '' or NULL in the generated SQL.

Select title, author, i.itemcallnumber from biblio b
Left join biblioitems bi on b.biblionumber=bi.biblionumber
Left join items i on bi.biblionumber=i.biblionumber
where i.barcode = <<Barcode #1>>
or i.barcode = <<Barcode #2>>
or i.barcode = <<Barcode #3>>
or i.barcode = <<Barcode #4>>
or i.barcode = <<Barcode #5>>
or i.barcode = <<Barcode #6>>


More information about the Koha mailing list