Q&A for Salesforce administrators, implementation experts, developers and anybody in-between
-- Sandbox ;WITH UsersSample AS ( SELECT u.Id FROM Users u tablesample(.1 percent) WHERE u.UpVotes > 1 ) SELECT u.Id as UserId, v.PostId, v.VoteTypeId FROM Votes v RIGHT OUTER JOIN UsersSample u ON v.UserId = u.Id WHERE v.VoteTypeId = 2 OR v.VoteTypeId = 3