[Koha] SQL help please

SATISH lis4satish at gmail.com
Tue Dec 12 18:36:43 NZDT 2017


Hi Kerrie,

Both sql's formats are working for me with

Koha 16.11.11 / Package Installation/ Ubuntu 14.04 Desktop with MySQL

Thanks to Pedro and Mark.

1)
-------------------------------
SELECT  CONCAT('<a
href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',biblio.biblionumber,'\">',biblio.biblionumber,'</a>')
AS biblionumbers, items.barcode
,items.itemcallnumber,biblioitems.isbn,biblio.author,biblio.title
FROM items
LEFT JOIN biblioitems ON
(items.biblioitemnumber=biblioitems.biblioitemnumber)
LEFT JOIN biblio ON (biblioitems.biblionumber=biblio.biblionumber)
WHERE items.barcode = <<Barcode #1>>
or items.barcode = <<Barcode #2>>
or items.barcode = <<Barcode #3>>
or items.barcode = <<Barcode #4>>
or items.barcode = <<Barcode #5>>
or items.barcode = <<Barcode #6>>
ORDER BY LPAD(items.barcode,30,' ') ASC

2)
-------------------------------
SELECT i.barcode, 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>>
---------------------------------

With Thanks
Satish


More information about the Koha mailing list