SELECT p.PostId,p.PostNoticeTypeId, YEAR(p.CreationDate) ...

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

SELECT 
p.PostId,p.PostNoticeTypeId, 
YEAR(p.CreationDate) as 'Creation_Date', 
YEAR(p.DeletionDate)as 'Deletion_Date', 
p.OwnerUserId, 
p.DeletionUserId, u.PostTypeId
FROM
PostNotices p, Posts u
WHERE
p.DeletionDate IS NOT NULL
AND p.DeletionUserId=-1
AND u.PostTypeId = 2
AND YEAR(p.CreationDate) <2019
AND p.PostId = u.Id
ORDER BY
p.OwnerUserId, YEAR(p.DeletionDate)

Enter Parameters

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