Re: how do i select this list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$query = mysql_query("SELECT * FROM leaderboard WHERE comp_id = $comp_id
ORDER by points DESC, margin ASC ");

Mark wrote:

> The query below gives me a list of usernames with the highest point score
> at the top. There is also a secondary points list which i need to use to
> rank players if there POINTS are the same.
> 
> ie:
> username      points     margin
>     paul            26            24
>     mark           23            11
>     john            23            10
> 
> I want to rank 'john above 'mark' as his margin points are lower. I can't
> rank by margin alone and i need ranking by points (Desc) first then by
> lowest margin.
> how can i change this statement below to achieve this.
> 
> Thanks
> 
> $query = mysql_query("SELECT * FROM leaderboard WHERE comp_id = $comp_id
> ORDER by points DESC ");

-- 
---------------------------------------------------
João Cândido de Souza Neto
Web Developer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux