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