Skip to main content
ExLibris
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    Multi-field SQL queries of Z00R

    • Article Type: General
    • Product: Aleph
    • Product Version: 17.01

    Description:
    I'm using z00r. I'm looking for all the serials that have a particular 049.

    Separate queries work well

    select z00r_doc_number from z00r where Z00R_FIELD_CODE = 'FMT' and Z00R_TEXT = 'SE';

    select z00r_doc_number from z00r where Z00R_FIELD_CODE = '049' and z00r_text like '%ILUU%';

    But when I try to combine them into one query, I 'm not getting any hits. I tried

    select z00r_doc_number from z00r where (Z00R_FIELD_CODE = 'FMT' and Z00R_TEXT = 'SE') and (Z00R_FIELD_CODE = '049' and z00r_text like '%ILUU%');

    Resolution:
    In the z00r, each field is a separate record. You would need to do this:

    SQL> select z00r_doc_number from z00r where z00r_doc_number in (select z00r_doc_number from z00r where Z00R_FIELD_CODE = 'FMT' and Z00R_TEXT = 'SE' ) and z00r_doc_number in (select z00r_doc_number from z00r where Z00R_FIELD_CODE = '049' and z00r_text like '%ILUU%' );

    Additional Information

    Z00R, SQL


    • Article last edited: 10/8/2013
    //Feedback