]> ruin.nu Git - ndwebbie.git/commitdiff
0 members is really 0
authorMichael Andreen <harv@ruin.nu>
Sun, 28 Jan 2007 18:24:29 +0000 (18:24 +0000)
committerMichael Andreen <harv@ruin.nu>
Sun, 28 Jan 2007 18:24:29 +0000 (18:24 +0000)
ND/Web/Pages/Alliances.pm

index 1500ca0bdcea57450fd31aeb1b7710ef0771781c..f9b830fc1c58a10c0a416a25a36a1e4dddb804dc 100644 (file)
@@ -130,7 +130,7 @@ sub render_body {
                        $order = "$1 DESC";
                }
                my $query = $DBH->prepare(qq{
-                       SELECT DISTINCT a.id,name,COALESCE(s.score,SUM(p.score)) AS score,COALESCE(s.size,SUM(p.size)) AS size,s.members,count(*) AS kmem,
+                       SELECT DISTINCT a.id,name,COALESCE(s.score,SUM(p.score)) AS score,COALESCE(s.size,SUM(p.size)) AS size,s.members,count(p.score) AS kmem,
                        COALESCE(SUM(p.score),-1) AS kscore, COALESCE(SUM(p.size),-1) AS ksize, COALESCE(SUM(p.xp),-1) AS kxp,COALESCE(SUM(p.value),-1) AS kvalue,
                        COALESCE(s.score/LEAST(s.members,60),-1) AS scavg, COALESCE(AVG(p.score)::int,-1) AS kscavg, COALESCE(s.size/s.members,-1) AS siavg,
                        COALESCE(AVG(p.size)::int,-1) AS ksiavg, COALESCE(AVG(p.xp)::int,-1) AS kxpavg, COALESCE(AVG(p.value)::int,-1) AS kvalavg