select t.ta_system_code,
t.ta_account_no,
t.cust_name,
t.ta_cfm_serial_no,
t.transaction_cfm_date,
t.product_code,
t.transaction_type
from cr_transaction t
where t.ta_return_code = ‘0000’
and t.ta_account_no
not in (select ta_account_no from cr_cust_calc_load_balance)
and t.ta_cfm_serial_no not in (
select t.ta_cfm_serial_no
from cr_transaction t
inner join cr_customer_account m on t.ta_account_no = m.ta_account_no
where t.ta_system_code = ‘ETFTA’
and m.ta_account_no is null
);
你这个性能差是带了太多的not in 和笛卡尔积 笛卡尔积我改了