select *
from t_cs_personcust t
where (is_new = '001' or is_new = '011' or is_new = '101' or
is_new = '111')
and not exists (select distinct cust_id
from t_cs_personcust_app
where (is_new = '001' or is_new = '011' or
is_new = '101' or is_new = '111')
and message_no = '初始导入'
and cust_id = t.cust_id);
检索数据2796条,检索时间 3.516 秒
select *
from t_cs_personcust t
where (is_new = '001' or is_new = '011' or is_new = '101' or
is_new = '111')
and cust_id not in (select distinct cust_id
from t_cs_personcust_app
where (is_new = '001' or is_new = '011' or
is_new = '101' or is_new = '111')
and message_no = '初始导入');
检索数据2796条,检索时间 45.14 秒[@more@]
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/96210/viewspace-1056687/
,如需转载,请注明出处,否则将追究法律责任。