[Koha] SQL query: Who has issued the '1234' barcoded book? and when?

Holger Meissner Holger.Meissner at hs-gesundheit.de
Wed Feb 5 02:05:23 NZDT 2014


HRS [bala.allmail at gmail.com] wrote:
> In looking SQL queries for
> 
> 1. Who has issued  the given barcoded book? and when?
> 2. What  are the books issued by staff-ID( with time) ?

SELECT action_logs.timestamp, borrowers.userid, borrowers.firstname, borrowers.surname, action_logs.action, items.barcode, biblio.title
FROM action_logs, borrowers, items, biblio
WHERE action_logs.action = 'ISSUE'
AND action_logs.user = borrowers.borrowernumber
AND items.biblionumber = biblio.biblionumber
AND items.itemnumber = action_logs.info

This will list all issues. To search for a specific barcode just add a line like:
AND items.barcode = 1234

To search for staff-ID add:
AND borrowers.userid = 'example'

Regards
Holger


More information about the Koha mailing list