SELECT top 10 ROW_NUMBER() OVER(ORDER BY Score DESC) AS [...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT top 10 ROW_NUMBER() OVER(ORDER BY Score DESC) AS [#], us.id [User Link],
       us.CreationDate as [Member from],
       us.age,
       tuser.Score as [c# score],    
       us.Reputation as [Total Reputation]
       
FROM Users us

JOIN 
(SELECT Answers.OwnerUserId AS UserId, SUM(Answers.Score) AS Score
     FROM Tags 
    JOIN PostTags ON Tags.Id = PostTags.TagId
    JOIN Posts ON Posts.Id = PostTags.PostId  
    JOIN Posts Answers ON Answers.ParentId = Posts.Id   
  GROUP BY Answers.OwnerUserId
) tuser ON tuser.UserId = us.Id

WHERE lower(us.Location) like '%kerala%'
ORDER BY Score DESC;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results