***

0

Please login or register to vote for this query.

(click on this box to dismiss)

Audio-Video Production Meta

Q&A about the site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation

-- Ranks open bounties on previously unbountied questions by amount
-- This doesn't seem to work, however...


declare @latestDate datetime
select @latestDate = max(CreationDate) from Posts

SELECT TOP 100 RANK() OVER (ORDER BY v.BountyAmount DESC) AS [Rank], v.BountyAmount as Bounty, p.Title as Title,p.Body as Body FROM
Posts p INNER JOIN Votes v ON p.Id = v.PostId
WHERE v.VoteTypeId = 8
AND datediff(day, @latestDate, v.CreationDate) < 7
AND p.PostTypeId = 1
AND p.Id not in 
  (SELECT p.ParentId FROM Posts p 
    INNER JOIN Votes v ON p.Id = v.PostId 
    WHERE p.PostTypeId != 1
    AND v.VoteTypeId = 9)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results