--PO
SELECT pah.*
FROM po_action_history pah,
po_headers_all pha
WHERE pah.object_type_code = 'PO'
AND pah.object_id = pha.po_header_id
AND pha.po_header_id = 614690 --订单题头ID
--PR
SELECT NAME
FROM apps.PER_POSITION_STRUCTURES_V
WHERE position_structure_id =
(SELECT DISTINCT approval_path_id
FROM PO.PO_ACTION_HISTORY
WHERE object_id = 614690
/*(SELECT requisition_header_id
FROM apps.po_requisition_headers_all
WHERE segment1 = '5400045' ---POR
AND org_id = 366 ---ORG
)*/
AND approval_path_id <> 0)
FROM apps.PER_POSITION_STRUCTURES_V
WHERE position_structure_id =
(SELECT DISTINCT approval_path_id
FROM PO.PO_ACTION_HISTORY
WHERE object_id = 614690
/*(SELECT requisition_header_id
FROM apps.po_requisition_headers_all
WHERE segment1 = '5400045' ---POR
AND org_id = 366 ---ORG
)*/
AND approval_path_id <> 0)