FROM (SELECT abb.bank_branch_id,
abb.bank_name,
abb.bank_branch_name,
REPLACE (abb.description, CHR (10), ' ') description,
abb.address_line1,
abb.address_line2,
abb.address_line3,
abb.city,
abb.state,
abb.zip,
abb.province,
abb.country,
abb.area_code,
abb.phone,
abb.contact_first_name,
abb.contact_middle_name,
abb.contact_last_name,
abb.contact_prefix,
abb.contact_title,
abb.bank_num,
abb.institution_type,
abb.address_style,
abb.bank_number,
abb.address_line4,
abb.county,
abb.eft_user_number,
abb.eft_swift_code,
abb.end_date,
abb.edi_id_number,
abb.bank_branch_type,
abb.bank_name_alt,
abb.bank_branch_name_alt,
abb.address_lines_alt,
abb.active_date,
abb.tp_header_id,
abb.ece_tp_location_code,
abb.rfc_identifier,
abb.bank_admin_email
FROM ap_bank_branches abb
WHERE NVL (abb.end_date, TRUNC (SYSDATE)) >= TRUNC (SYSDATE)
AND EXISTS
(SELECT *
FROM ap_bank_accounts_all aba
WHERE NVL (aba.inactive_date, TRUNC (SYSDATE)) >=
TRUNC (SYSDATE)
AND aba.bank_branch_id = abb.bank_branch_id)) a
abb.bank_name,
abb.bank_branch_name,
REPLACE (abb.description, CHR (10), ' ') description,
abb.address_line1,
abb.address_line2,
abb.address_line3,
abb.city,
abb.state,
abb.zip,
abb.province,
abb.country,
abb.area_code,
abb.phone,
abb.contact_first_name,
abb.contact_middle_name,
abb.contact_last_name,
abb.contact_prefix,
abb.contact_title,
abb.bank_num,
abb.institution_type,
abb.address_style,
abb.bank_number,
abb.address_line4,
abb.county,
abb.eft_user_number,
abb.eft_swift_code,
abb.end_date,
abb.edi_id_number,
abb.bank_branch_type,
abb.bank_name_alt,
abb.bank_branch_name_alt,
abb.address_lines_alt,
abb.active_date,
abb.tp_header_id,
abb.ece_tp_location_code,
abb.rfc_identifier,
abb.bank_admin_email
FROM ap_bank_branches abb
WHERE NVL (abb.end_date, TRUNC (SYSDATE)) >= TRUNC (SYSDATE)
AND EXISTS
(SELECT *
FROM ap_bank_accounts_all aba
WHERE NVL (aba.inactive_date, TRUNC (SYSDATE)) >=
TRUNC (SYSDATE)
AND aba.bank_branch_id = abb.bank_branch_id)) a
No comments:
Post a Comment