Tag Wikis with the Most Edits

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

SET ROWCOUNT 20

SELECT P.Id, (SELECT T.Id FROM Tags T WHERE T.WikiPostId = P.Id) AS TagNo, (SELECT 'site://tags/' + T.TagName + '/info' + '|' + T.TagName FROM Tags T WHERE T.WikiPostId = P.Id) AS TagURL, SUBSTRING(P.Body, 0, 80) AS [Blurb], (SELECT Count(V.Id) FROM Votes V WHERE V.PostId = P.Id AND V.VoteTypeId = 16) AS [Edits], CONVERT(CHAR(12), P.CommunityOwnedDate, 107) AS [Created], CONVERT(CHAR(12), P.LastActivityDate, 107) AS [Modified]
FROM   Posts P, PostTypes Pt, Votes V, VoteTypes Vt
WHERE Pt.Id = 5
AND Vt.Id = 16
AND P.Id = V.PostId
AND Vt.Id = V.VoteTypeId
AND Pt.Id = P.PostTypeId
GROUP BY P.Id, P.Body, P.CommunityOwnedDate, P.LastActivityDate
ORDER BY Edits DESC

Enter Parameters

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