foo wrote:
> 
> Hi,
> 
> I have a mysql table with columns pts_t2, pts_ext and pts_other which hold
> each player's point total for that category. I have it displaying player's
> ranks by ordering by each of those points. However, I would like to have an
> overall ranking (all categories combined), and I don't want to add another
> column to just hold a total of these 3 columns. How can I order my select
> statement to list the players by order of their total points?
> 

select pts_t2 + pts_ext + pts_other as pts_total
from players
order by pts_total desc

The trick is to alias the equation above as a column, and then
reference it in the order by.

-Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to