SELECT MAX(i.PUID),
  MAX(i.PITEM_ID),
  MAX(Ir.PITEM_REVISION_ID),
  Ir.Rsequence_Anchoru,
  Ir.PUID as Ir_Puid ,
  Max(Ir.Psequence_Id)
FROM Infodba.Pitemrevision Ir
INNER JOIN infodba.PITEM i
ON i.PUID     = Ir.RITEMS_TAGU
WHERE Ir.PUID = 'Q0QNyQS7TzDfjB'
GROUP BY Ir.RSEQUENCE_ANCHORU,
  Ir.PUID
HAVING MAX(i.PUID) IN
  (SELECT i.PUID
  FROM infodba.Pitemrevision ir
  INNER JOIN Pitem i
  ON ir.RITEMS_TAGU = i.PUID
  WHERE ir.PUID     = 'Q0QNyQS7TzDfjB'
  )