select ooh.order_number, hca.account_number, hp.party_name
  from oe_order_headers_all   ooh,
       hz_cust_site_uses_all  hcsua, -- uses of customer addresses
       HZ_CUST_ACCT_SITES_ALL hcasa, -- customer addresses
       hz_cust_accounts       hca, -- customer accounts
       hz_parties             hp -- parties
 where ooh.ship_to_org_id = hcsua.site_use_id -- or a.invoice_to_org_id
   and hcsua.cust_acct_site_id = hcasa.cust_acct_site_id
   and hcasa.cust_account_id = hca.cust_account_id
   and hca.party_id = hp.party_id
   and ooh.order_number = P_order_number
創作者介紹
創作者 隨手筆記 的頭像
芭樂養樂多

隨手筆記

芭樂養樂多 發表在 痞客邦 留言(0) 人氣( 36 )