Generalist badge

23

Please login or register to vote for this query.

(click on this box to dismiss)

Displays all 40 top tags and your score in each tag. You need to get at least 15 points in 20 tags

Coffee

Q&A for people interested in all aspects of producing and consuming coffee

-- Generalist badge
-- Displays all 40 top tags and your score in each tag. You need to get at least 15 points in 20 tags

declare @UserId int = ##UserId##;

select row_number() over (order by upvotes desc, Count desc),tagName, Count, upvotes from 
   (select top 40 * from Tags Order by Count desc) t
left join 
   (select pt.TagId, count(distinct v.id) upvotes from posts a 
   join posts p on p.Id = a.ParentId
   join postTags pt on pt.PostId = p.Id
   join votes v on v.voteTypeId=2 and v.postId=a.Id
   where a.OwnerUserId=@UserId
   group by pt.TagId) v
on t.Id=v.TagId
order by 1

Enter Parameters

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