How many upvotes do I have for each tag?

328

Please login or register to vote for this query.

(click on this box to dismiss)

how long before I get tag badges?

Q&A for IT security professionals

-- How many upvotes do I have for each tag?
-- how long before I get tag badges?

DECLARE @UserId int = ##UserId##

SELECT --TOP 20 
    TagName,
    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 TagName 
ORDER BY UpVotes DESC

Enter Parameters

Options:
Switch sites:
Hold tight while we fetch your results
{"cc_re__cc_re__cc_by_sa_3_0": ["t</a>\r\n                <a href=\"https://data.stackexchange.com\">data</a>\r\n                <a href=\"https://stackexchange.com/legal\">legal</a>\r\n                <strong><a href=\"http://meta.stackexchange.com/contact\">contact us</a></strong>\r\n                <strong><a href=\"http://meta.stackexchange.com\">feedback</a></strong>\r\n            </div>\r\n            <div id=\"copyright\">\r\n                site design / logo &copy; 2019 Stack Exchange Inc; \r\n                user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a>\r\n                with <a href=\"https://stackoverflow.blog/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"revision\">rev 2018.4.24.63</div>\r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">\r\n            Data Explorer works best with JavaScript enabled</div>\r\n    </noscript>\r\n    <script>\r\n(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\r\n(i[r].q=i[r].q||[]).p"], "copyright__copyright__copyright": ["tes do I have for each tag?\n-- how long before I get tag badges?\n\nDECLARE @UserId int = ##UserId##\n\nSELECT --TOP 20 \n    TagName,\n    COUNT(*) AS UpVotes \nFROM Tags\n    INNER JOIN PostTags ON PostTags.TagId = Tags.id\n    INNER JOIN Posts ON Posts.ParentId = PostTags.PostId\n    INNER JOIN Votes ON Votes.PostId = Posts.Id and VoteTypeId = 2\nWHERE \n    Posts.OwnerUserId = @UserId\nGROUP BY TagName \nORDER BY UpVotes DESC\n\nEnter Parameters\n\nOptions:\nSwitch sites:\nHold tight while we fetch your results"]}