Q&A for SharePoint enthusiasts
-- WITH SuggEds AS ( SELECT se.OwnerUserId as [User Link], p.Id as [Post Link], u.Reputation, up.Reputation, p.PostTypeId, se.*, p.* FROM SuggestedEdits se LEFT JOIN Posts p ON p.Id = se.PostId LEFT JOIN Users u ON (u.Id = se.OwnerUserId) LEFT JOIN Users up ON (u.Id = p.OwnerUserId) WHERE se.ApprovalDate IS NULL AND se.RejectionDate IS NULL AND PostTypeId in (1, 2) -- )