Fastest-closed questions with 5 close votes

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

--SELECT TOP 100 p.Id as [Post Link], p.CreationDate as [Create Date],
--              p.ClosedDate as [Close Date]
--  from Posts p, Votes v
--  where p.PostTypeId = 1 and DATEDIFF(DAY, p.CreationDate, p.ClosedDate) < 1
  
  
--  order by p.ClosedDate - p.CreationDate asc

--select p.id, count(v.postid) from posts p, votes v
--where p.id = v.postid
--and v.votetypeid = 6
--group by v.postid, p.id

SELECT TOP 10 p.Id as [Post Link],
              p.CreationDate as [Create Date],
              p.ClosedDate as [Close Date]
FROM Posts p
WHERE (SELECT count(*) from Votes where PostTypeId = 6 and PostId = p.Id) > 0
AND p.PostTypeId = 1
AND DATEDIFF(DAY, p.CreationDate, p.ClosedDate) < 1
ORDER BY p.ClosedDate - p.CreationDate asc

Enter Parameters

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