SELECT TOP 10 p.Id as question, d.Id as answer, d.OwnerUs...


Please login or register to vote for this query.

(click on this box to dismiss)

Super User

Q&A for computer enthusiasts and power users

SELECT TOP 10 p.Id as question, d.Id as answer, d.OwnerUserId as answererId, d.Reputation as answerer_reputation, vt.UpVotes, vt.DownVotes, d.CreationDate
FROM Posts as p
 SELECT c.Id, c.ParentId, c.CreationDate, c.OwnerUserId, u.Reputation 
 From Posts AS c 
 JOIN Users AS u ON c.OwnerUserId = u.AccountId
 WHERE c.PostTypeId=2 AND c.CreationDate BETWEEN '2015-07-31' AND '2017-12-31'
     ) AS d ON d.ParentId = p.Id
 SELECT v.PostId,
   SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes,
   SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes
 FROM Votes AS v
 GROUP BY v.PostId
) AS vt ON d.Id = vt.PostId
WHERE p.CreationDate BETWEEN '2015-07-31' AND '2017-12-31' AND p.AnswerCount=3
ORDER BY p.CreationDate ASC, d.CreationDate ASC;

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results