how long before I get tag badges?
Q&A about the site for those interested in the study of the fundamental nature of knowledge, reality, and existence
-- How many upvotes do I have for each tag?
-- how long before I get tag badges?
set nocount on
declare @topTags table (id int, name nvarchar(35), questionCount int)
select top 40 Id, TagName, Count from Tags order by Count desc
declare @userTopTags table (name nvarchar(35), score int)
select name as [TagName], sum(Posts.Score) as Score from @topTags
inner join PostTags on PostTags.TagId = id
inner join Posts on Posts.ParentId = PostTags.PostId
where Posts.OwnerUserId = ##UserId:int##
and Posts.CommunityOwnedDate is null
and Posts.PostTypeId = 2
group by name order by Score desc
set nocount off
select * from @userTopTags