I’m trying to come up with a more efficient method to do this.
I have a table where people enter some info into the table.

The more entries they add the more “points” they get.
(1 point per entry).

I would like to allow the users to be able to see where they stand rank wise with everyone else.
Right now I basically do a SELECT count(1) as entries, user_id GROUP BY user_id ORDER BY entries DESC.


Then loop through the results until I match their user_id and count how many times I go through the loop and that is how I can give them their ranking. It just seems like a big waste to loop through the results until I find their user_id.

I was wondering if anyone could think of a better way to do this.

Thanks,
Mike




-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to