Find interesting unanswered questions - Top 5 tags - 500 results - after date

1

Please login or register to vote for this query.

(click on this box to dismiss)

Looks at unanswered questions active after some limit date in your top 5 tags and sorts them by a combined weight which takes into account: score, askers reputation and how well you do on that particular tag. *** Work as expected

Physics

Q&A for active researchers, academics and students of physics

-- Find interesting unanswered questions
-- Looks at unanswered questions in your top 5 tags and sorts them by
-- a combined weight which takes into account: score, askers reputation and how
-- well you do on that particular tag

DECLARE @UserId int = ##UserId##
DECLARE @lastActivityDateLimit date = ##lastActivityDateLimit##

create table #tags (TagId int, TagName nvarchar(35), [Count] int)

insert #tags 
SELECT TOP 5 
    TagId, TagName,
    COUNT(*) AS UpVotes 
FROM Tags
    INNER JOIN PostTags ON PostTags.TagId = Tags.id 
    INNER JOIN Posts ON Posts.ParentId = PostTags.PostId
    INNER JOIN Votes ON Votes.PostId = Posts.Id and VoteTypeId = 2
WHERE 
    Posts.OwnerUserId = @UserId
GROUP BY TagId, TagName
ORDER BY UpVotes DESC


create table #unanswered (Id int primary key)

insert #unanswered 
select q.Id  from Posts q
where (select count(*) from Posts a where a.ParentId = q.Id and a.Score > 0) = 0
AND q.LastActivityDate > @lastActivityDateLimit
and CommunityOwnedDate is null and ClosedDate is null and q.ParentId is null 
and AcceptedAnswerId is null


select top 500 u.Id as [Post Link], t.TagName as [Tag Name],
(sum(t.[Count]) / 10.0 + us.Reputation / 200.0 + p.Score * 100) as Weight 
from #unanswered u
LEFT join Posts p on u.Id = p.Id
LEFT join PostTags pt on pt.PostId = u.Id
LEFT join #tags t on t.TagId = pt.TagId AND t.TagId NOT IN ( 
        SELECT Tags.id FROM Tags 
          WHERE Tags.TagName IN ('android', 'linux', 'logging','performace','arcgis','arcgis-server')) 
LEFT join Users us on us.Id = p.OwnerUserId  
group by u.Id, us.Reputation, p.Score, t.TagName
order by Weight desc

Enter Parameters

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