Re: create ranking

From: Date: Wed, 15 Jan 2003 10:44:54 +0000
Subject: Re: create ranking
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-17876@lists.php.net to get a copy of this message
You can create an auxiliary table, that holds the number of teams for each points amount: CREATE TEMPORARY TABLE T SELECT Points, MIN( Rank ) AS SmallerRank FROM myTable GROUP BY Points You get: Points SmallerRank 10 1 9 2 7 4 Now you join this table to the original table on Points. You get SmallerRank instead of Rank. HTH Ignatius ____________________________________________ ----- Original Message ----- From: "Rico Derks" <derks@few.vu.nl> To: <php-windows@lists.php.net> Sent: Wednesday, January 15, 2003 10:53 AM Subject: [PHP-WIN] create ranking > Hi, > > I'am trying to create a ranking from a mysql database. My problem is that I > don't know how to determine exaequo ranking!! Exaequo means that two teams > with the same amount of points get the same rank. > > Wrong: > Rank Team Points > 1 Team1 10 > 2 Team2 9 > 3 Team3 9 > 4 Team4 7 > > Correct: > Rank Team Points > 1 Team1 10 > 2 Team2 9 > 2 Team3 9 > 4 Team4 7 > > Can anyone help me with this problem. > > Cheers, RICO. > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.windows (#17876) next »