Anton.Sandbox

1

Please login or register to vote for this query.

(click on this box to dismiss)

TeX Meta

Q&A about the site for users of TeX, LaTeX, ConTeXt, and related typesetting systems

/* How much each user asked questions and gave answers

Random sample of users is taken (for research).

PostTypeId = 1 is question
PostTypeId = 2 is answer
*/


;WITH UsersSample AS
(
  SELECT u.Id
  FROM Users u tablesample(1 percent)
  )
  SELECT p.PostTypeId, p.OwnerUserId, p.OwnerUserId AS [User Link],
  COUNT(*) as n
FROM Posts p
RIGHT OUTER JOIN UsersSample u ON u.Id = p.OwnerUserId
WHERE p.OwnerUserId > 0
GROUP BY p.OwnerUserId, p.PostTypeId
ORDER BY p.OwnerUserId, p.PostTypeId

Enter Parameters

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