ITPub博客

首页 > 数据库 > Oracle > Oracle PR and PO之间关联SQL

Oracle PR and PO之间关联SQL

原创 Oracle 作者:zqhcy 时间:2007-07-21 22:19:31 0 删除 编辑
SELECT porh.segment1 pr,
poh.segment1 po,
p.full_name Buyer,
pov.vendor_name,
hrl1.location_code,
pol.line_num,
msi.segment1,
pol.item_description,
pol.unit_meas_lookup_code,
pol.quantity,
pll.need_by_date need_by,
pll.promised_date promised_by
FROM po_requisition_headers_all porh,
po_requisition_lines_all porl,
po_req_distributions_all pord,
po_headers_all poh,
po_lines_all pol,
po_line_locations_all pll,
po_distributions_all pod,
po_vendors pov,
po_vendor_sites_all povs,
per_people_f p,
hr_locations hrl1,
mtl_system_items msi
--po_releases_all por
WHERE pod.po_header_id = poh.po_header_id
AND pod.po_line_id = pol.po_line_id
--AND poh.po_header_id = pol.po_header_id
AND pod.line_location_id = pll.line_location_id
--AND pod.po_release_id = por.po_release_id(+)
AND pod.req_distribution_id = pord.distribution_id(+)
AND pord.requisition_line_id = porl.requisition_line_id(+)
AND porl.requisition_header_id = porh.requisition_header_id(+)
AND pov.vendor_id(+) = poh.vendor_id
AND povs.vendor_site_id(+) = poh.vendor_site_id
AND poh.agent_id = p.person_id
AND hrl1.location_id(+) = poh.ship_to_location_id
AND pol.item_id = msi.inventory_item_id(+)
AND pol.org_id = msi.organization_id (+)
AND porh.segment1>=:P_FROM_PR
AND porh.segment1<=:P_TO_PR[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/45641/viewspace-927330/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: Oracle Workfiow
请登录后发表评论 登录
全部评论
  • 博文量
    23
  • 访问量
    76462