Posted on 2010-03-23 16:08
追梦人 阅读(180)
评论(0) 编辑 收藏 所属分类:
mysql
select dr.name, round(sum(dr.killed)/((case sum(dr.deaded) when 0 then 1 else sum(dr.deaded) end)), 2) ,round(avg(dr.assists), 2) from dota dr where dr.type=3 group by dr.name
case sum(dr.deaded) when 0 then 1 else sum(dr.deaded) end 当sum(dr.deaded)为0时取1,否则取本身