@@ -, +, @@ You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RANK, biblio.biblionumber AS ID, itemcallnumber as CALLNUM, ccode as CCODE, loca' at line 1 --- reports/cat_issues_top.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/reports/cat_issues_top.pl +++ a/reports/cat_issues_top.pl @@ -298,7 +298,7 @@ sub calculate { my $strcalc ; # Processing average loanperiods - $strcalc .= "SELECT DISTINCT biblio.title, COUNT(biblio.biblionumber) AS RANK, biblio.biblionumber AS ID"; + $strcalc .= "SELECT DISTINCT biblio.title, COUNT(biblio.biblionumber) AS `RANK`, biblio.biblionumber AS ID"; $strcalc .= ", itemcallnumber as CALLNUM"; $strcalc .= ", ccode as CCODE"; $strcalc .= ", location as LOC"; @@ -346,7 +346,7 @@ sub calculate { $strcalc .= " group by biblio.biblionumber"; $strcalc .= ", $colfield" if ($column); - $strcalc .= " order by RANK DESC"; + $strcalc .= " order by `RANK` DESC"; $strcalc .= ", $colfield " if ($colfield); my $dbcalc = $dbh->prepare($strcalc); --