|
select distinct * from (select b.branchcode,c.name,b.AgentCode,b.AgentName, a.AlarmYM,a.AlarmBatchNo,a.ContNo,a.RiskCode, a.StartVisitDate, (select codename from ldcode where codetype='PreviewType' and a.AlarmIndexType=code ) as PreviewType, a.VisitResult,a.TreatResult, (select Codename from ldcode where CodeType='instype' and a.TreatResult = Code) as instype,a.TreatViews ,a.AlarmIndexType from LACheckVisit a left outer join LAAgentInfo b on a.AgentCode=b.AgentCode left outer join LABranchGroupInfo c on a.branchcode=c.AgentGroup where 1=1 and exists (select 1 from lacompanyinfo where b.BranchCode=branchcode and citycomcode='340400' ) and a.AlarmYM='200810' and a.AlarmBatchNo='1' ) as result
执行该语句的时候,消耗cpu75%,哪位大哥帮忙分析一下,有优化的余地没? 谢谢 |
|