Q&A for experienced flyers, pilots, and builders of drones and model aircraft
DECLARE @UserId int = 2501279 -- ##UserId## DECLARE @LookBackPeriod int = 3 DECLARE @LookBackShift int = 0 DECLARE @MinLookBackDays int = 0 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