Suggestor

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

declare @UserId int

select top 1 @UserId=Id from Users where DisplayName = '##DisplayName##'

select top 10 
  q.Id as [Post Link], q.Tags,
  TotalSignal
from Posts q
join (select top 1000 PostId, sum(Signal)/count(1) TotalSignal
      from PostTags pt
      left join (select pt.TagId, count(1)/ptc.TagCount as Signal
            from Posts a
            join Posts q on q.Id = a.ParentId
            join PostTags pt on q.Id = pt.PostId
            join (select TagId, cast(count(1) as float) as TagCount 
                  from PostTags 
                  group by TagId
                  having count(1)>10) ptc on ptc.TagId=pt.TagId
            where a.OwnerUserId = @UserId
            and a.PostTypeId = 2
            group by pt.TagId, ptc.TagCount
            having count(1)>1
      ) profile on profile.TagId = pt.TagId
      group by PostId
      order by TotalSignal desc
) matches on matches.PostId = q.Id
where q.PostTypeId = 1
and q.ClosedDate is null
and AcceptedAnswerId is null
and not exists (select 1 from Posts where ParentId = q.Id and OwnerUserId = @UserId)
and AnswerCount = 0
order by newid() desc

Enter Parameters

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