--Description: erm. IrId Create + LastMod Date 30.08.2011 18:07 mod case for MSSql J.Fes
SELECT ir.pitem_revision_id AS IrRev,
  i.pitem_id                AS ItemName,
  i.puid                    AS ItemPuid,
  paoIr.plast_mod_date      AS IrLastModDate,
  paoIr.pcreation_date      AS IrCreateDate,
  s.psite_id                AS OwningSite_TC_pSite_ID
FROM infodba.PITEMREVISION ir
LEFT JOIN infodba.PITEM i on (i.puid = ir.ritems_tagu)
LEFT JOIN infodba.PPOM_OBJECT o on (ir.puid = o.puid)
LEFT JOIN infodba.PPOM_IMC s on (o.rowning_siteu = s.puid)
LEFT JOIN infodba.PPOM_APPLICATION_OBJECT paoIr on (ir.puid = paoIr.puid)
WHERE ir.puid = :ir_puid

