-- OK selectieren der Rev 
select ir.PITEM_REVISION_ID
from INFODBA.PITEMREVISION ir
inner join 
 (select IR.RSEQUENCE_ANCHORU,
         max(IR.PSEQUENCE_ID) as MAX_PSEQUENCE_ID
  from INFODBA.PITEMREVISION IR
  where regexp_like(IR.PITEM_REVISION_ID,'rev','i')
  group by IR.RSEQUENCE_ANCHORU) IR2
ON ir.RSEQUENCE_ANCHORU = IR2.RSEQUENCE_ANCHORU
AND ir.PSEQUENCE_ID     = IR2.MAX_PSEQUENCE_ID