-- SQL um das ITEM der Revision zu erhalten
Select Pitem.Puid, 
PITEMREVISION.PITEM_REVISION_ID,
  PITEM.PITEM_ID
 FROM PITEMREVISION
INNER JOIN PITEM
ON PITEMREVISION.RITEMS_TAGU = PITEM.PUID
WHERE PITEMREVISION.PUID = 'Q3SNyQSrTzDfjB'


-- SQL um alle Rev des Items zu erhalten 
SELECT PITEMREVISION.RSEQUENCE_ANCHORU AS IR_ANCHORU ,
  max(PITEMREVISION.PSEQUENCE_ID) as IR_MAXPSEQUENCE_ID
-- into SUBTAB 
FROM PITEMREVISION
where regexp_like(PITEMREVISION.PITEM_REVISION_ID,'rev','i')
GROUP BY PITEMREVISION.RSEQUENCE_ANCHORU ; 