From a7d97832df4ebc5f8793942bf008b9d7e1079d8e Mon Sep 17 00:00:00 2001 From: hdl Date: Thu, 31 Mar 2005 06:47:25 +0000 Subject: [PATCH] Minor fix : Counting biblio and not items --- reports/cat_issues_top.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reports/cat_issues_top.pl b/reports/cat_issues_top.pl index dc956d8c6c..fddcf6d58b 100755 --- a/reports/cat_issues_top.pl +++ b/reports/cat_issues_top.pl @@ -280,7 +280,7 @@ sub calculate { my $strcalc ; # Processing average loanperiods - $strcalc .= "SELECT biblio.title, COUNT(*) AS RANK, biblio.biblionumber AS ID"; + $strcalc .= "SELECT DISTINCT biblio.title, COUNT(biblio.biblionumber) AS RANK, biblio.biblionumber AS ID"; $strcalc .= " , $colfield " if ($colfield); $strcalc .= " FROM `issues`,borrowers,(items LEFT JOIN biblioitems ON biblioitems.biblioitemnumber=items.biblioitemnumber) LEFT JOIN biblio ON (biblio.biblionumber=items.biblionumber) WHERE issues.itemnumber=items.itemnumber AND issues.borrowernumber=borrowers.borrowernumber and returndate is not null"; @@ -305,7 +305,7 @@ sub calculate { @$filters[9]=~ s/\*/%/g if (@$filters[9]); $strcalc .= " AND year(issues.timestamp) like '" . @$filters[9] ."'" if ( @$filters[9] ); - $strcalc .= " group by borrowers.borrowernumber"; + $strcalc .= " group by biblio.biblionumber"; $strcalc .= ", $colfield" if ($column); $strcalc .= " order by "; $strcalc .= "$colfield, " if ($colfield); -- 2.39.5