Counts the number of edits a user has made to posts
Q&A about the site for serious players and enthusiasts of chess
-- User Edit Count -- Counts the number of edits a user has made to posts DECLARE @UserId int = ##UserId## SELECT COUNT(*) FROM ( SELECT Id FROM Posts WHERE Id IN ( SELECT PostId FROM PostHistory WHERE PostHistoryTypeId IN ( SELECT Id FROM PostHistoryTypes WHERE Name = 'Edit Title' OR Name = 'Edit Body' ) AND UserId = @UserId ) AND OwnerUserId <> @UserId AND CommunityOwnedDate IS NULL ) AS PostsWithEdits