Seguimiento a medalla Iluminador

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   a.Score
       , a.ParentId
       , a.CreationDate
       , q.Title
  from Posts a
       inner join Posts q on q.Id = a.ParentId
 where a.PostTypeId = 2
   and a.OwnerUserID = @userID
   and a.CommunityOwnedDate is null
   and a.Score > 0
   and a.OwnerUserID != q.OwnerUserID
   and exists (select 1
                 from PostHistory qh
                where qh.PostId = q.Id
                  and qh.UserId = @userID
                  and abs(datediff(minute, qh.CreationDate, a.CreationDate)) <= (12*60) 
              )
 order by a.CreationDate desc;

Enter Parameters

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