码迷,mamicode.com
首页 > 数据库 > 详细

sql for SB

时间:2017-08-03 16:59:34      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:sql   ota   count   for   rate   cee   led   rom   label   

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

标签:sql   ota   count   for   rate   cee   led   rom   label   

原文地址:http://www.cnblogs.com/jing99/p/7280300.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!