Generalist badge

16

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

Mathematics

Q&A for people studying math at any level and professionals in related fields

-- 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 sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached