Here is an example of using ROW_NUMBER with the OVER and ORDER BY in v5r4
--The above example was provided by one of our Top Notch programmers and Code400 members (kast1) here in Phoenix. Thanks Lance!
PHP Code:
SELECT row_number()
OVER( partition by opaccount order by Dec( OPINVDAT ), 8, 0 ) as RowNo,
opaccount, opinvdat
FROM Lib/Table
WHERE OPBALOPN = 'O' ;
Comment