irc
Tue 13th Feb '01, 12:05pm
I am creating a database driven website that will generate stats for improv shows based on how many votes a particular team gets. For my all time rankings page, one of the stats I like to use to rank teams "average votes per show", but I want to prevent teams that only appeared once from showing up in the query results.
The current query I'm using is this:
SELECT team.name, AVG(score.score) AS average
FROM team, score, fight*
WHERE fight.fightid = score.fightid AND score.teamid = team.teamid
AND fight.exhibition = "No"
GROUP BY team.teamid
ORDER BY average DESC LIMIT 10
*I need the fight table to exclude Exhibition matches.
I thought I could do it by adding a column for total votes and then add a WHERE parameter comparing average and total, but that caused an error.
Let me know if you need more information to visualize the problem. You can see a "beta" version of the site at www.cage-match.com/index.php to help you understand what is going on. Look on the "rankings" page.
The current query I'm using is this:
SELECT team.name, AVG(score.score) AS average
FROM team, score, fight*
WHERE fight.fightid = score.fightid AND score.teamid = team.teamid
AND fight.exhibition = "No"
GROUP BY team.teamid
ORDER BY average DESC LIMIT 10
*I need the fight table to exclude Exhibition matches.
I thought I could do it by adding a column for total votes and then add a WHERE parameter comparing average and total, but that caused an error.
Let me know if you need more information to visualize the problem. You can see a "beta" version of the site at www.cage-match.com/index.php to help you understand what is going on. Look on the "rankings" page.