Hi.

I have a query that determines the ranking of teams in a league by
several calculations on the table.  Below is the query:

SELECT TeamName,TeamWins,TeamLosses,TeamSpirit,
(TeamSpirit/(TeamWins+TeamLosses)*100) AS AvgSpirit,
((TeamWins*2)-TeamLosses) AS TeamPoints
FROM Teams_1
WHERE DivisionName = 'A Division'
AND LeagueID = 1
ORDER BY TeamPoints,AvgSpirit

But the newly created attribute, AvgSpirit, will fail when a team has
not won or lost a game ...

Any ideas on how to remedy this problem?

Thanks for the help,
Camilo Rostoker


--
+====================================================+

Camilo Rostoker
Web Developer
Scottsdale I.T. Consulting

[EMAIL PROTECTED]
http://www.scottsdale.ca/

+====================================================+



---------------------------------------------------------------------
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