SELECT
 /*MsSQL TOP (1) MsSQL*/
 iMa.pitem_id AS PFMaster_ItemId,
 irMa.pitem_revision_id AS PFMaster_IrId,
 iMe.pitem_id AS PFMember_ItemId,
 wsoMa.pobject_name AS PFMasterFolder_Name,
 fMa.puid AS PFMasterFolder_Puid
FROM
 infodba.PITEMREVISION irMa
 INNER JOIN infodba.PITEM iMa ON (iMa.puid = irMa.ritems_tagu)
 -- get From IrMa releation ptypeMa.ptype_name = 'IMAN_UG_part_family_link'
 LEFT JOIN infodba.PIMANRELATION prMa ON (prMa.rsecondary_objectu = irMa.puid)
 LEFT JOIN infodba.PIMANTYPE ptypeMa ON (ptypeMa.puid = prMa.rrelation_typeu)
 -- get Folder add below PFMa Item
 LEFT JOIN infodba.PIMANRELATION rMa ON (rMa.rprimary_objectu = iMa.puid)
 LEFT JOIN infodba.PFOLDER fMa ON (fMa.puid = rMa.rsecondary_objectu)
 LEFT JOIN infodba.PWORKSPACEOBJECT wsoMa ON (wsoMa.puid = fMa.puid)
 -- get Member IrMe + iMe
 LEFT JOIN infodba.PITEMREVISION irMe ON (irMe.puid = prMa.rprimary_objectu)
 INNER JOIN infodba.PITEM iMe ON (iMe.puid = irMe.ritems_tagu)
 -- get Folder PFMe Item
 LEFT JOIN infodba.PCONTENTS cMe ON (cMe.pvalu_0 = iMe.puid)
 LEFT JOIN infodba.PFOLDER fMe ON (fMe.puid = cMe.puid)
 LEFT JOIN infodba.PWORKSPACEOBJECT wsoMe ON (wsoMe.puid = fMe.puid)
WHERE
 ptypeMa.ptype_name = 'IMAN_UG_part_family_link'
 AND wsoMa.pobject_name IS NOT NULL
 -- connect PFMaster PFMember folder puid both must be equal
 AND fMa.puid = fMe.puid
 -- 'RNKAAAxJIZI$wB' -- 'BBOAAAxJIZI$wB' IRMaster
 AND irMa.puid = :ir_puid
/*Ora AND ROWNUM <= 1 Ora*/
