Jason Goemaat upvotes ด้วยแท็ก ไม่จำเป็นต้องใช้ตารางทั้งหมด
Jason Goemaat upvotes by tag.It is not neccessary to use all the tables.
 ReviewRejectionReasons:  Id [ number]  Name [ text]  Description [ text]  PostTypeId [ number] 
SELECT 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