SELECT fb.book_type_code,
fth.ASSET_NUMBER,
fdh.units_assigned,
fdh.assigned_to,
pf.FULL_NAME,
fl.segment3 location_name
FROM FA_ADDITIONS_V fth,
fa_distribution_history fdh,
gl_code_combinations gcc,
fa_books fb,
per_people_f pf,
FA_LOCATIONS fl
WHERE fth.ASSET_ID = fdh.asset_id
and fth.ASSET_ID = fb.asset_id
and fdh.code_combination_id = gcc.code_combination_id
and (gcc.segment2 = '' or gcc.segment9 = '')
and fdh.assigned_to = pf.PERSON_ID(+)
and fdh.location_id = fl.location_id(+)
and not exists (select null
from FA_RETIREMENTS_V fr
where fth.ASSET_ID = fr.ASSET_ID)
and nvl(fdh.date_ineffective, sysdate) >= sysdate
order by fth.ASSET_NUMBER; select * from FA_LOCATIONS
05-02 22:38