Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    87

    Smile Unanswered: how to use the ROWNUM in a query

    hi all,

    Please find the query below.

    SELECT SUBSTR(IMP_NAME_ADD,1,INSTR(IMP_NAME_ADD, ','))AS NAME, SUBSTR(IMP_NAME_ADD,INSTR(IMP_NAME, ',')+1)AS ADDRESS, BSDMASTER.TBSD_INST_MST.INST_NAME AS BANKNAME, FORM_NO,IMPORT_ITEM, DOCS_DESC, SUB_DUE_DATE
    FROM TBAS_DTR216, BSDMASTER.TBSD_INST_MST, TBAS_TED_TRN_HDR
    WHERE TBAS_DTR216.TED_CR_TRN_ID = TBAS_TED_TRN_HDR.TED_CR_TRN_ID
    AND BSDMASTER.TBSD_INST_MST.INST_ID = TBAS_TED_TRN_HDR.INST_CODE
    AND SUB_DUE_DATE BETWEEN '12-JUN-02' AND '21-JUN-02'
    /

    In this query i want to display output part by part like first 5 then next 5.

    i want to give that in the query . Shall i add

    ROWNUM BETWEEN &a AND &b

    for a and b i'll pass values 1 and 5 ..etc.

    Can anyone help me to write the final query?



    thanx in advance.

  2. #2
    Join Date
    Sep 2003
    Location
    Hanoi- Vietnam
    Posts
    27
    You can use your query as subquery with nam A :
    Select ... From A Where rownum between &a and %b.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •