SELECT Ir.PUID,
  Ir.PITEM_REVISION_ID
FROM Pitemrevision Ir
WHERE Ir.PUID       = 'wYeNyQS7TzDfjB'
AND Ir.PSEQUENCE_ID =
  (SELECT DISTINCT MAX(Ir2.PSEQUENCE_ID)
  FROM PITEMREVISION Ir
  INNER JOIN PITEMREVISION Ir2
  ON Ir.RSEQUENCE_ANCHORU = Ir2.RSEQUENCE_ANCHORU
  WHERE Ir.PUID           = 'wYeNyQS7TzDfjB'
  )