Quality Control

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

-- When Posts were deleted by Community system. Constraints from the system itself, 
-- This constraint system can increase/decrease motivation and quality of users
DECLARE @UserId int = ##UserId##

SELECT
u.OwnerUserId, Deleted_Year = Min(YEAR(u.DeletionDate)), p.PostTypeId, DeletionUserId
FROM PostNotices u, Posts p 
WHERE 
u.PostId = p.Id
AND DeletionUserId = -1

GROUP BY 
u.OwnerUserId, PostTypeId, DeletionUserId
HAVING 
u.OwnerUserId = @UserId
Order By 
 u.OwnerUserId, PostTypeId DESC

Enter Parameters

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