select pi.pitem_id,pws.pobject_desc,pir.pitem_revision_id,pit.ptype_name,
pi1.pitem_id,pir1.pitem_revision_id,pws1.pobject_desc
from infodba.pitemrevision pir
join infodba.pitem pi on pir.ritems_tagu =pi.puid --AND pi.PITEM_ID ='12200560006'
join infodba.pworkspaceobject pws on pir.puid=pws.puid and pws.pobject_type like 'L8%PartRevision' AND pws.pobject_desc LIKE '半成品电池,BZ%'
join infodba.pimanrelation prel1 on prel1.rprimary_objectu =pir.puid
join infodba.pitemrevision pir1 on pir1.ritems_tagu =prel1.rsecondary_objectu
join infodba.pitem pi1 on pir1.ritems_tagu =pi1.puid --and pi1.pitem_id='12200500037'
AND pir1.PITEM_REVISION_ID =
(
SELECT PITEM_REVISION_ID FROM
(select rownum,pir.PITEM_REVISION_ID from infodba.pitemrevision pir
join infodba.pitem pix on pir.ritems_tagu =pix.puid and pix.pitem_id=pi1.pitem_id ORDER BY pir.PITEM_REVISION_ID DESC ) WHERE rownum=1
)
join infodba.pworkspaceobject pws1 on pir1.puid=pws1.puid and pws1.pobject_type like 'L8%PartRevision'
join infodba.pimantype pit on prel1.rrelation_typeu =pit.puid
;
SELECT PITEM_REVISION_ID FROM
(select rownum,pir.PITEM_REVISION_ID from infodba.pitemrevision pir
join infodba.pitem pi on pir.ritems_tagu =pi.puid and pi.pitem_id='12200500037' ORDER BY pir.PITEM_REVISION_ID DESC ) WHERE rownum=1
标签:pitem,join,infodba,puid,查询,Teamcenter,版本,pir,id From: https://www.cnblogs.com/PLM-Teamcenter/p/18226955