declare @AccountID varchar (10)declare @AccountID2 varchar (10)
declare @AccountID3 varchar (10)
declare @Name varchar(10)
declare @Name2 varchar(10)
declare @Name3 varchar(10)
Select top 1 @AccountID=AccountID,@Name=Name from RankingDevilSquare order by Score_semanal desc, name desc
Select top 1 @AccountID2=AccountID,@Name2=Name from RankingDevilSquare where Name<>@Name order by Score_semanal desc, name desc
Select top 1 @AccountID3=AccountID,@Name3=Name from RankingDevilSquare where Name<>@Name and Name<>@Name2 order by Score_semanal desc, name desc
Update CashShopData set WCoinC = WCoinC + 50, WCoinP = WCoinP + 500 where AccountID=@AccountID
Update CashShopData set WCoinC = WCoinC + 20, WCoinP = WCoinP + 200 where AccountID=@AccountID2
Update MK_MEDALHAS set medal_evento=1 where login=@AccountID3
UPDATE RankingDevilSquare SET Score_semanal = 0