• The optimiser will do this anyway but simplify your query and you clarify the index requirements:

    SELECT MAX(POST_DT)  
    FROM
    IDX_INCOME  
    WHERE
    GRP__2 =
    '7'
       AND INV_NUM =
    '0'

    If you don't already have an index on GRP__2 and INV_NUM which also includes POST_DT in the KEY or INCLUDE part, then you might need one.

      

     


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]