Query :
select
abb.bank_name,
abb.bank_branch_name,
abb.address_line1,
abb.address_line2,
abb.city,
abb.province,
abb.country,
aba.bank_account_name,
aba.bank_account_num,
aba.currency_code,
(gl1.segment1||'.'||gl1.segment2||'.'||gl1.segment3||'.'||gl1.segment4||'.'||gl1.segment5||'.'||gl1.segment6||'.'||gl1.segment7) coa_gain,
(gl2.segment1||'.'||gl2.segment2||'.'||gl2.segment3||'.'||gl2.segment4||'.'||gl2.segment5||'.'||gl2.segment6||'.'||gl2.segment7) coa_los,
(gl3.segment1||'.'||gl3.segment2||'.'||gl3.segment3||'.'||gl3.segment4||'.'||gl3.segment5||'.'||gl3.segment6||'.'||gl3.segment7) coa_cash,
(gl.segment1||'.'||gl.segment2||'.'||gl.segment3||'.'||gl.segment4||'.'||gl.segment5||'.'||gl.segment6||'.'||gl.segment7) asset_account
from
ap_bank_accounts_all aba,
ap_bank_branches abb,
gl_code_combinations gl,
gl_code_combinations gl1,
gl_code_combinations gl2,
gl_code_combinations gl3
where
aba.bank_branch_id=abb.bank_branch_id
and abb.end_date is null
and aba.org_id=137
and gl.code_combination_id=aba.asset_code_combination_id
and gl1.code_combination_id=aba.gain_code_combination_id
and gl2.code_combination_id=aba.loss_code_combination_id
and gl3.code_combination_id=aba.cash_clearing_ccid;
No comments:
Post a Comment