Anton.Sandbox

1

Please login or register to vote for this query.

(click on this box to dismiss)

Personal Finance and Money

Q&A for people who want to be financially literate

-- Random sample of users with all of their votes for questions
-- Bigger samples go above the 50K limit on output

;WITH UsersSample AS
(
  SELECT u.Id, u.UpVotes
  FROM Users u tablesample(.5 percent)
  WHERE u.UpVotes > 1
  )
SELECT u.Id as UserId, u.UpVotes as UserUpVotes,
  v.PostId, v.VoteTypeId
FROM Votes v
  RIGHT OUTER JOIN UsersSample u
    ON v.UserId = u.Id
-- WHERE
--   v.VoteTypeId > 1 AND v.VoteTypeId < 4

Enter Parameters

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