/*增幅降幅排名*/
複製** **如下:
select top 50 username,sum(receiveprice) - sum(guessprice) as receiveprice,
cast(sum(case wicoybimhen 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 w 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 h**ing count(userid) >= 5
order by cast(sum(case when receiveprice>0www.cppcns.com then 1.0 else 0 end) / count(receiveprice) * 1 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語句小結
本文位址:
看世界盃的感想
看世界盃的感想 這幾天看世界盃,有幾點感想 一 現場轉播好神奇,全世界在同乙個時間看同乙個東西,而且它正在發生。二 踢球應該球員們的水平差別不是很大,都比常人多出乙個大致等高的平台,可是有些人就更高個 10 或多少的。他們就是球星,首先拿高工資,再就是被廣大球迷注意,再乙個人代表著乙個球隊,再乙個人...
世界盃前的期待
四年一度的世界盃即將開賽!你支援哪個國家呢?今年好巧不巧,世界盃的比賽都是在凌晨,這可苦了時差黨!現在只恨自己不在現場!只得凌晨爬起來看球!木有辦法!明天球賽就要開始了,得趕緊把準備的東西備好!男的嘛,有啤酒有炸雞差不多了!不男的乙個人在家看可能太無聊,建議藉著這個機會,把喜歡看球的家人朋友啊,聚集...
世界盃印象之該削減哪個洲的世界盃名額
前一陣國際足聯布拉特對亞洲放出狠話 如果亞洲無隊進十六強,下屆將減少亞洲世界盃名額 估計國際足聯對亞洲的不爽已經由來已久,不過他們的不爽也是有理由的,畢竟德國世界盃上亞洲球隊沒有拿得出手的成績。不過這屆世界盃小組賽一結束,世界足聯再提削減亞洲名額,就站不住腳了。眾所周知,世界盃是世界強隊之間的一次交...