select count(1) from ( select * from icd.tbilllog8 where callidnum = '-1' and callbegin between trunc(to_date('2006-08-30','yyyy-mm-dd')) and trunc(to_date('2006-08-31','yyyy-mm-dd'))) A, (select called_area_code from knowledge_ywipcode where area_name like '%铁通%') B where substr(A.callerno, 5, 3) = B.called_area_code or substr(A.callerno, 13, 3) = B.called_area_code
from ( select * from icd.tbilllog8
where callidnum = '-1'
and callbegin between trunc(to_date('2006-08-30','yyyy-mm-dd'))
and trunc(to_date('2006-08-31','yyyy-mm-dd'))) A,
(select called_area_code from knowledge_ywipcode
where area_name like '%铁通%') B
where substr(A.callerno, 5, 3) = B.called_area_code
or substr(A.callerno, 13, 3) = B.called_area_code
2)like语句用了两次,增加了查询复杂度,影响效率