DECLARE @UserId int = ##UserId## SELECT COUNT(DISTINCT p...

0

Please login or register to vote for this query.

(click on this box to dismiss)

DevOps Meta

Q&A about the site for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure

DECLARE @UserId int = ##UserId##

SELECT COUNT(DISTINCT ph.PostId)
    FROM PostHistory ph
    WHERE
        ph.UserId = @UserId AND
        ph.PostHistoryTypeId IN (4, 5, 7, 9) AND
        ph.PostId NOT IN (SELECT p.Id FROM Posts p WHERE p.OwnerUserId = @UserId)

Enter Parameters

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