22,210
社区成员
发帖
与我相关
我的任务
分享
select top 10 UserAccounts.userid,isnull(Nickname,'') as Nickname ,isnull(sum(GiftCount*50),0) as score, GiftID from UserAccounts
join GiveGiftLog
on UserID2 = UserAccounts.userid
and giftid = 101
and usertype=20
and RecordTime between DATEADD(ww, DATEDIFF(ww,0,getdate()),0) and DateAdd(ww, 1, DATEADD(ww, DATEDIFF(ww,0,getdate()),0))
group by UserAccounts.userid,Nickname,giftid
having isnull(sum(GiftCount*50),0)>2400000
order by score desc
select top 10 UserAccounts.userid,isnull(Nickname,'') as Nickname ,isnull(sum(GiftCount*50),0) as score, GiftID from UserAccounts
join GiveGiftLog
on UserID2 = UserAccounts.userid
and giftid = 101
and usertype=20
and RecordTime between DATEADD(ww, DATEDIFF(ww,0,getdate()),0) and DateAdd(ww, 1, DATEADD(ww, DATEDIFF(ww,0,getdate()),0))
group by UserAccounts.userid,Nickname,giftid
having sum(GiftCount*50) > 2400000
order by score desc