Skip to main content
ExLibris

Knowledge Assistant

BETA
 
  • Subscribe by RSS
  • Back
    Aleph

     

    Ex Libris Knowledge Center
    1. Search site
      Go back to previous article
      1. Sign in
        • Sign in
        • Forgot password
    1. Home
    2. Aleph
    3. Knowledge Articles
    4. SQL to locate items with fewer (or more) than x loans

    SQL to locate items with fewer (or more) than x loans

    1. Last updated
    2. Save as PDF
    3. Share
      1. Share
      2. Tweet
      3. Share
    1. Additional Information
    2. Attachment
    • Article Type: General
    • Product: Aleph
    • Product Version: 20

    Desired Outcome Goal:
    List of books which have fewer (or more) than x loans (for weeding purposes).

    Procedure:
    1. On server, vi items_with_fewer-more_than_x_loans.sql (it will initially be, non-existent/empty)
    2. Paste contents of attached file into items_with_fewer-more_than_x_loans.sql
    3. Change "XXXXX" to library's sublibrary code (in uppercase)
    4. Edit " HAVING COUNT(*) < '5' ": change sign to ">" or increase/decrease loan-count threshold
    5. s+ xxx50
    6. SQL> @items_with_fewer-more_than_x_loans.sql
    7. View the items_for_weeding.lst output

    Additional Information

    The z35_event_date could be used to limit the results retrieved to a particular time period.

    Note: If the z35 records have been deleted for the time period of interest, the z30_no_loan (the number of loans of the item) column might be used, though that is just a total; no way to look for the number of loans in the past x years.

    Attachment

    Attached file

    Category: System Management (500)


    • Article last edited: 10/30/2014
    View article in the Exlibris Knowledge Center
    1. Back to top
      • SQL to locate BIB/HOL recs without items; BIBs without ADM; etc. *MASTER RECORD*
      • SQL to locate items with z30_hol_doc_number which bib record isn't actually linked to
    • Was this article helpful?

    Recommended articles

    1. Article type
      Topic
      Language
      English
      Product
      Aleph
    2. Tags
      1. 20
      2. contype:kba
      3. Prod:Aleph
      4. System Management (500)
      5. Type:General
    1. © Copyright 2025 Ex Libris Knowledge Center
    2. Powered by CXone Expert ®
    • Term of Use
    • Privacy Policy
    • Contact Us
    2025 Ex Libris. All rights reserved