SQL Error on AS400

  • I am trying to run this query on AS400 and it gives an error message as

    Token MAX was not valid. Valid tokens: FOR WITH FETCH ORDER UNION OP..

    The Query is

    SELECT DM1196PF.DRG_CODE, DM1196PF.DRG_DESC

    FROM

    DM1196PF

    WHERE

    RTRIM(DM1196PF.GRPR_NAME) = 'CMS' AND DM1196PF.GRPR_VRSN = SELECT MAX(GRPR_VRSN) AS GRPRVRSN FROM DM1196PF WHERE RTRIM(DM1196PF.GRPR_NAME) = 'CMS' GROUP BY GRPR_NAME, DRG_CODE

     

    Is there any other way to use MAX function for AS400??

  • Please post in an appropriate forum...the "Question of the Day" forum is specifically for responding to the Question of the Day quiz.

    -SQLBill

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply