test

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 50 a.Id AS [Post Link], b.NumberOfDuplicates
FROM Posts AS a
LEFT JOIN (
SELECT Posts.Id, COUNT(PostLinks.RelatedPostId) AS NumberOfDuplicates
FROM Posts, PostLinks
WHERE Posts.Id = PostLinks.RelatedPostId AND PostLinks.LinkTypeId = 3
GROUP BY Posts.Id
) AS b ON a.Id = b.Id
LEFT JOIN (
SELECT Posts.Id, COUNT(PostHistory.Id) AS NumberOfMerges
FROM Posts, PostHistory
WHERE Posts.Id = PostHistory.PostId AND PostHistory.PostHistoryTypeId = 37
GROUP BY Posts.Id
) AS c ON b.Id = c.Id
WHERE c.NumberOfMerges = 0 AND a.AnswerCount = 0
ORDER BY b.NumberOfDuplicates DESC;

Enter Parameters

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