Ratio of duplicates with newer targets

1

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.Id, P.CreationDate, Q.Id, Q.CreationDate, Q.ClosedDate
  100
    * Sum(case when Q.CreationDate < P.CreationDate then 1 else 0 end)
    / Cast(Count(Q.Id) as Float)
from Posts Q
  inner join PostLinks L on L.PostId = Q.Id
  inner join Posts P on P.Id = L.RelatedPostId
where Q.ClosedDate is not null
  and L.LinkTypeId = 3
  --and Abs(Datediff(Second, Q.ClosedDate, Q.CreationDate)) >= 7 * 24 * 3600
  --and Q.AnswerCount <> 0
  --and Q.AcceptedAnswerId is not null

Enter Parameters

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