At 7:46 PM -0600 10/30/01, Camilo Rostoker wrote:
>I have a query that determines the ranking of teams in a league by
>several calculations on the table. Below is the query:
>(TeamSpirit/(TeamWins+TeamLosses)*100) AS AvgSpirit,
>((TeamWins*2)-TeamLosses) AS TeamPoints
>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?
(TeamSpirit/(TeamWins+TeamLosses)*100) AS AvgSpirit,
IFNULL((TeamSpirit/(TeamWins+TeamLosses)*100),0) AS AvgSpirit,
>Thanks for the help,