select a.ReportPerson,a.sumOfError,b.solvedError from(select COUNT(ErrorID) as sumOfError,ReportPerson from PCR_ConstructInfo where (ReportTime>beginTime) and (ReportTimeendTime) group by ReportPerson) a left join (select ReportPerson,COUNT(ErrorID) as solvedError from PCR_ConstructInfo where (State=2) and (ReportTime>beginTime) and (ReportTimeendTime) group by ReportPerson) b on (a.ReportPerson=b.ReportPerson)