Actually you don't need to join some tables. All that you need are found on table User
.
UPVOTES
as well as DOWNVOTES
are anonymous that is why you cannot count it. The value already exist on column UpVotes
and DownVotes
Query
SELECT [User Link], UpVotes, rn
FROM
(
SELECT a.ID as [User Link],
a.UpVotes,
DENSE_RANK() OVER (ORDER BY a.UpVotes DESC) rn
FROM Users a
)x
WHERE rn <= 10
ORDER BY UpVotes DESC