Worst Case Scenario - How long until the

0

Please login or register to vote for this query.

(click on this box to dismiss)

スタック・オーバーフロー

プログラマーとプログラミングに熱心な人々のための質問と回答

-- Worst Case Scenario - How long until the 
-- Enter Query Description

declare @UserId int = ##UserId##
declare @voteCount int

select @voteCount = u.UpVotes + u.DownVotes
from Users u
where u.Id = @UserId


select case
    when @voteCount < 600 then 5 + ceiling((600 - @voteCount)/30.0)
    when exists(select Id from Badges where UserId = @UserId and Name = 'Electorate') then 'got it'
    else ceiling(@voteCount / (4 * 30.0))
end

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results