Patron Reading History With Working ItemRecordIDs
This query can be used as a basis for dealing with data in the PatronReadingHistory table. For instance, it could be modified to search for the reading history of a specific patron, sets of patrons, or to look for titles, etc. The original use of this file was to provide data as a CSV for import into another ILS as a library migrated away from Polaris.
FROM
Polaris.Polaris.PatronReadingHistory prh WITH (NOLOCK)
JOIN
Polaris.Polaris.ItemRecords ir WITH (NOLOCK) ON ir.ItemRecordID = prh.ItemRecordID
JOIN
Polaris.Polaris.BibliographicRecords br WITH (NOLOCK) ON br.BibliographicRecordID = ir.AssociatedBibRecordID
JOIN
Polaris.Polaris.Patrons p WITH (NOLOCK) ON p.PatronID = prh.PatronID
JOIN
Polaris.Polaris.Organizations o WITH (NOLOCK) ON prh.LoaningOrgID = o.OrganizationID
WHERE
prh.ItemRecordID IS NOT NULL
ORDER BY
prh.CheckOutDate DESC,
prh.PatronID