This content has been marked as final. Show 2 replies
You need to link the item in the primary query with the max in the subquery.
Assuming that ILLITM is the item than the query would be like this:
select X.ILLITM, X.ILDOC, X.ILDCT, X.ILTRDJ from CRPDTA.F4111 X where X.ILTRDJ in (select max(ILTRDJ) from CRPDTA.F4111 Y where Y.ILLITM = X.ILLITM);