Account Inquiry (总账与子账的关联 - Cost Management - Receiving)

本文介绍了一个复杂的SQL查询案例,该查询涉及多个表的联接操作,包括采购订单、收货记录、供应商信息等,用于从Oracle EBS系统中获取详细的交易记录。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


select pha.segment1 po_number,
       pv.vendor_name,
       pv.segment1 supplier_num,
       pha.currency_code,
       pla.line_num,
       plla.shipment_num,
       pla.item_description,
       pla.unit_price,
       plla.quantity,
       plla.quantity_received,
       plla.quantity_billed,
       rt.transaction_type,
       rt.transaction_date
  
from gl.gl_je_headers            h,
       gl.gl_je_lines              l,
       gl.gl_code_combinations     gcc,
       gl.gl_import_references     gir,
       apps.xla_ae_lines           xal,
       apps.xla_distribution_links xdl,
       po.rcv_receiving_sub_ledger rrsl,
       po.rcv_transactions         rt,
       po.po_headers_all           pha,
       po.po_lines_all             pla,
       po.po_line_locations_all    plla,
       apps.po_vendors             pv
 
where h.je_header_id = l.je_header_id
   
and l.code_combination_id = gcc.code_combination_id
   
and gcc.segment1 = '801'
      
--and gcc.segment2 in ('21200101', '21200201')
   and gcc.segment2 = '21200201'
   
and l.je_header_id = gir.je_header_id
   
and l.je_line_num = gir.je_line_num
   
and gir.gl_sl_link_id = xal.gl_sl_link_id
   
and xal.ae_header_id = xdl.ae_header_id
   
and xal.ae_line_num = xdl.ae_line_num
   
and xdl.source_distribution_id_num_1 = rrsl.rcv_sub_ledger_id
   
and rrsl.rcv_transaction_id = rt.transaction_id
   
and rt.po_header_id = pha.po_header_id
   
and rt.po_header_id = pla.po_header_id
   
and rt.po_line_id = pla.po_line_id
   
and pla.po_header_id = plla.po_header_id
   
and pla.po_line_id = plla.po_line_id
   
and pha.vendor_id = pv.vendor_id
   
and h.ledger_id = 2041 --UTSC
   and h.je_source = 'Cost Management'
   
and h.je_category = 'Receiving'
   
and h.status = 'P'
   
and h.period_name in ('MAR-08''FEB-08')


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值