Find

1

Please login or register to vote for this query.

(click on this box to dismiss)

German Language Meta

Q&A about the site for speakers of German wanting to discuss the finer points of the language and translation

DECLARE @UserId int = 2501279 -- ##UserId##
DECLARE @LookBackPeriod int = 10
DECLARE @LookBackShift int = 0

DECLARE @MinLookBackDays int = 4

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

insert #tags 
SELECT TOP 5
    TagId,
    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
ORDER BY UpVotes DESC


select top 20 p.Title, concat('https://stackoverflow.com/questions/', p.Id), p.Tags,  p.*
from Posts p
join PostTags pt on pt.PostId = p.Id
join #tags t on t.TagId = pt.TagId  
where DeletionDate is null 
AND CreationDate > DATEADD(DD, -@MinLookBackDays - @LookBackPeriod - @LookBackShift, CAST(CURRENT_TIMESTAMP AS DATE))
AND PostTypeId IN (1, 2)
order by  ViewCount/20 + Score desc

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results