Q&A about the site for professors, theologians, and those interested in exegetical analysis of biblical texts
SELECT MAX(L.RelatedPostId) AS [Post Link], SUM(CASE WHEN L.LinkTypeId = 3 THEN 1 ELSE 0 END) AS DupLinkCount, SUM(CASE WHEN L.LinkTypeId = 1 THEN 1 ELSE 0 END) AS NonDupLinkCount, COUNT(*) AS AnyLinkCount FROM PostLinks L GROUP BY L.RelatedPostId HAVING COUNT(*) > 100 ORDER BY DupLinkCount DESC