首页 > 代码库 > sql for SB

sql for SB

select t1.projectLabel,t1.modulLabel,t1.environment,t1.succeedcount,t2.failedcount,t1.succeedcount+t2.failedcount as totalcount,t1.succeedcount*1.0/(t1.succeedcount+t2.failedcount) as succeedrate
from
(select projectLabel,modulLabel,environment,count(1) as succeedcount
from
where op = ‘SUCCEED‘

group by  projectLabel,modulLabel,environment) t1,

(select projectLabel,modulLabel,environment,count(1) as succeedcount
from
where op = ‘FAILED‘ group by  projectLabel,modulLabel,environment) t2
where t1.projectLabel=t2.projectLabel and t1.modulLabel= t2.modulLabel and t1.environment = t2.environment

sql for SB