How many posts have I edited?

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

Declare @UserId int = ##UserId##
select count(distinct b.Postid)-count(distinct a.Postid) as 'Posts Edited'
from PostHistory a, PostHistory b where
a.UserId=@UserId and b.UserId=a.UserId and
a.PostHistoryTypeId in (1,2,3) and b.PostHistoryTypeId in (1,2,3,4,5,6,7,8,9)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results