select fb.book_type_code,
fab.asset_number 资产编号,
fab.tag_number 标签号,
ca.segment1 资产大类,
ca.segment2 资产小类,
gcc.segment2 部门段,
fl.concatenated_segments 资产地点,
fb.original_cost 原始成本,
fb.cost 当前成本,
(select max(u.deprn_reserve)
from apps.FA_DEPRN_SUMMARY u
where 1 = 1
and u.asset_id = fab.asset_id) 累计折旧, --可能有小数点差异
fb.cost - (select max(u.deprn_reserve)
from apps.FA_DEPRN_SUMMARY u
where 1 = 1
and u.asset_id = fab.asset_id) 残值,
fab.DESCRIPTION,
fdh.*
from apps.fa_additions_V fab,
apps.fa_books fb,
apps.FA_CATEGORIES_B CA,
apps.FA_DISTRIBUTION_HISTORY fdh, --存在一个资产多行分配行
apps.gl_code_combinations gcc,
apps.fa_locations_kfv fl
where 1 = 1
and fab.asset_category_id = ca.category_id
and fab.asset_id = fb.asset_id
and fdh.asset_id = fab.asset_id
and fb.book_type_code = fdh.book_type_code