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 find titles of books with the highest circulations

    SQL to find titles of books with the highest circulations

    1. Last updated
    2. Save as PDF
    3. Share
      1. Share
      2. Tweet
      3. Share
    No headers
    • Article Type: General
    • Product: Aleph
    • Product Version: 19.01

    Description:
    What SQL can be used to find the titles of books with the highest circulations?

    Resolution:
    [Note: This uses the adm z103 to read the z13 from the bib library.]

    select
    title||'\'||
    call_no||'\'||
    qty
    from
    (select count(z30_barcode) as qty, z30_call_no as call_no, z13_title as title
    from z36h, z30, law01.z13, z103
    where z30_item_process_status is null and z30_collection = 'MAIN' and
    substr(z30_rec_key, 1,9) = substr(z36H_rec_key, 1,9) and
    substr(z36H_rec_key, 1,9) = substr(z13_rec_key, 1,9) and
    z36H_loan_date >= '20050101' and
    z36H_loan_date <= '20101130' and
    z30_barcode = z30_barcode and
    z30_no_loans > 50 and
    z36H_loan_date is not null and
    Z13_REC_KEY = substr (Z103_REC_KEY_1,6,9) and
    substr (Z103_REC_KEY_1,1,5) = 'ABC01' and
    substr (Z103_REC_KEY,6,9) = substr (Z30_REC_KEY,1,9)
    group by z30_barcode, z13_title, z30_call_no
    order by z30_barcode, z13_title, z30_call_no
    )
    where qty >=50;


    • Article last edited: 10/8/2013
    View article in the Exlibris Knowledge Center
    1. Back to top
      • SQL to find sum of what patrons owe
      • SQL to get list of patrons with patron type is "RH", with barcode, address, etc.
    • Was this article helpful?

    Recommended articles

    1. Article type
      Topic
      Language
      English
      Product
      Aleph
    2. Tags
      1. 19.01
      2. contype:kba
      3. Prod:Aleph
      4. 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