SQL 實現某時間段的統計業務建站知識
導讀:1建站知識有一張錯誤上報表,現在要做的是統計在某個時間段[beginTime,endTime](其中beginTime,endTime由前臺進行傳入)內,每個上網站建設教程網站優化seo培訓。
有一張錯誤上報表,下面只將與本文相關的字段羅列如下:上報人(ReportPerson)、上報錯誤ID(ErrorID)、上報時間(ReportTime)、狀態(State),其中值為0(未解決)、1(已處理)、2(已解決)。 現在要做的是統計在某個時間段[beginTime,endTime](其中beginTime,endTime由前臺進行傳入)內,每個上報人上報錯誤點的總數以及已解決錯誤的總數。
復制代碼 代碼如下:
select a.ReportPerson,a.sumOfError,b.solvedError from(select COUNT(ErrorID) as sumOfError,ReportPerson from PCR_ConstructInfo where (ReportTime>beginTime) and (ReportTime<endTime) group by Rep網站建設哪家好ortPerson) a left join (select ReportPerson,COUNT(ErrorID) as solvedError from PCR_ConstructInfo where公司網站建設 (State=2) and (ReportTime>beginTime) and (ReportTime<endTime) group by Re網seo優化趨勢portPerson) b on (a.ReportPerson=b.ReportPerson)
生成的結果圖為: 相關網站建設教程網站優化seo培訓。聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-24 ,文章SQL 實現某時間段的統計業務建站知識主要講述標簽,業務,SQL網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.comhttp://www.hbqbqssxx.com