s/264094/is-there-a-sede-query-to-find-number-of-up-votes-received/264095#264095ไม่จำเป็นต้องใช้ตารางทั้งหมด
s/264094/is-there-a-sede-query-to-find-number-of-up-votes-received/264095#264095It is not neccessary to use all the tables.
 Votes:  Id [ number]  PostId [ number]  VoteTypeId [ number]  UserId [ number]  CreationDate [ time]  BountyAmount [ number] 
SELECT COUNT(*) AS "number_of_upvotes" FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId WHERE v.VoteTypeId = 2 AND p.OwnerUserId = '##userid:int##'