Re: Calculating User Ranks (SQL Query Question)

2004-12-24 Thread Don Read
On 22-Dec-2004 Michael J. Pawlowsky wrote: 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. snip I would like to allow the users to be able to see where they stand rank wise with everyone else. Right now I

Calculating User Ranks (SQL Query Question)

2004-12-22 Thread Michael J. Pawlowsky
Im 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

Re: Calculating User Ranks (SQL Query Question)

2004-12-22 Thread SGreen
Try this: CREATE TEMPORARY TABLE tmpRankings ( Rank int auto_increment, entries int, user_id int ) INSERT tmpRankings (points, user_id) SELECT count(1), user_id FROM sometablenamehere GROUP BY user_id ORDER BY entries DESC; This way the tmpRankings table contains an