How do I get to know a particular user’s rank, after the query is executed? This is in SQL Server 2005. For example, the query that I use is:
CREATE PROCEDURE [dbo].[getmyRankinContest]
@UserID int
AS
BEGIN
select userid,
from
invitecount
group by userid
order by sum(points) desc
END
But @UserID is my UserID. How can I add @UserID in the above code to get my rank? Any suggestions, please?
Thanks in advance..
You can try something like this: