主页 > 知识库 > 世界杯猜想活动的各类榜单的SQL语句小结

世界杯猜想活动的各类榜单的SQL语句小结

热门标签:临沂智能电销机器人加盟哪家好 镇江网路外呼系统供应商 百度地图标注改颜色 小e电话机器人 电销外呼有录音系统有哪些 申请400电话在哪办理流程 外呼运营商线路收费 贵州房产智能外呼系统供应商 一个导航软件能用几个地图标注点
/*增幅降幅排名*/
复制代码 代码如下:

Select top 50 UserName,sum(ReceivePrice) - sum(GuessPrice) as ReceivePrice,
cast(sum(CASE WHEN ReceivePrice>0 THEN 1.0 ELSE 0 END) / count(ReceivePrice) * 100 as numeric(4,1)) as Rate
From [game_FantasyLog]
WHERE IsJudge=1
GROUP BY UserId,UserName
ORDER BY sum(ReceivePrice) - sum(GuessPrice) ASC

/*正确率错误率排名*/
复制代码 代码如下:

Select top 50 UserName,sum(ReceivePrice) - sum(GuessPrice) as ReceivePrice,
cast(sum(CASE WHEN ReceivePrice>0 THEN 1.0 ELSE 0 END) / count(ReceivePrice) * 100 as numeric(4,1)) as Rate
From [game_FantasyLog]
WHERE IsJudge=1
GROUP BY UserId,UserName Having count(UserId) >= 5
ORDER BY cast(sum(CASE WHEN ReceivePrice>0 THEN 1.0 ELSE 0 END) / count(ReceivePrice) * 100 as numeric(4,1)) ASC

/*大手笔排名*/
复制代码 代码如下:

Select top 50 l.UserName,sum(l.GuessPrice),sum(l.ReceivePrice),f.title
From [game_FantasyLog] l left join [game_fantasy] f on l.topicid = f.id
GROUP BY l.TopicId,l.UserName,f.title
ORDER BY sum(l.GuessPrice) DESC

/*冷门场次排名*/
复制代码 代码如下:

Select top 50 f.id,f.title,f.GuessPrice,(select sum(receivePrice) FROM [game_FantasyLog] l where l.topicid = f.id),
cast((select sum(CASE WHEN ReceivePrice>0 THEN 1.0 ELSE 0 END) / f.GuessTimes FROM [game_FantasyLog] l2 where l2.topicid = f.id) as numeric(4,2))
From [game_Fantasy] f WHERE f.GuessPrice > 1000
ORDER BY (select sum(receivePrice) FROM [game_FantasyLog] l where l.topicid = f.id) ASC

/*冷门场次的命中者*/
复制代码 代码如下:

Select top 50 UserName,sum(ReceivePrice) as ReceivePrice
From [game_FantasyLog] where topicid=29
GROUP BY TopicId,UserName
ORDER BY sum(ReceivePrice) DESC

标签:延边 日照 三明 澳门 嘉兴 保定 晋城 合肥

巨人网络通讯声明:本文标题《世界杯猜想活动的各类榜单的SQL语句小结》,本文关键词  世界杯,猜想,活动,的,各类,;如发现本文内容存在版权问题,烦请提供相关信息告之我们,我们将及时沟通与处理。本站内容系统采集于网络,涉及言论、版权与本站无关。
  • 相关文章
  • 下面列出与本文章《世界杯猜想活动的各类榜单的SQL语句小结》相关的同类信息!
  • 本页收集关于世界杯猜想活动的各类榜单的SQL语句小结的相关信息资讯供网民参考!
  • 推荐文章