]> git.sesse.net Git - wloh/commitdiff
When making division ranking, only include the players that are active in the current...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 23 Apr 2012 22:43:46 +0000 (00:43 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 23 Apr 2012 22:43:46 +0000 (00:43 +0200)
www/rating.pl

index 604ca289595c00ae294e92adf919d78192881dc6..0c42ccc8ee29e79bef376ad5ab4d36cd93747735 100755 (executable)
@@ -84,8 +84,10 @@ printf <<"EOF", $params{-3}, $match_stddev;
       </tr>
 EOF
 
-$q = $dbh->prepare('SELECT divisjon,AVG(rating) AS avg_rating,STDDEV(rating) AS stddev_rating FROM ratings NATURAL JOIN siste_divisjon GROUP BY divisjon ORDER BY divisjon');
-$q->execute;
+my $season = wloh_common::get_max_season($dbh);
+
+$q = $dbh->prepare('SELECT divisjon,AVG(rating) AS avg_rating,STDDEV(rating) AS stddev_rating FROM ratings NATURAL JOIN siste_divisjon WHERE sesong=? GROUP BY divisjon ORDER BY divisjon');
+$q->execute($season);
 
 my $i = 0;
 while (my $ref = $q->fetchrow_hashref) {