Lines 240-246
sub calculate {
Link Here
|
240 |
my $strcalc ; |
240 |
my $strcalc ; |
241 |
|
241 |
|
242 |
# Processing average loanperiods |
242 |
# Processing average loanperiods |
243 |
$strcalc .= "SELECT CONCAT_WS('', borrowers.surname , \",\\t\", borrowers.firstname), COUNT(*) AS RANK, borrowers.borrowernumber AS ID"; |
243 |
$strcalc .= "SELECT CONCAT_WS('', borrowers.surname , \",\\t\", borrowers.firstname), COUNT(*) AS `RANK`, borrowers.borrowernumber AS ID"; |
244 |
$strcalc .= " , $colfield " if ($colfield); |
244 |
$strcalc .= " , $colfield " if ($colfield); |
245 |
$strcalc .= " FROM `old_issues` |
245 |
$strcalc .= " FROM `old_issues` |
246 |
LEFT JOIN borrowers USING(borrowernumber) |
246 |
LEFT JOIN borrowers USING(borrowernumber) |
Lines 265-271
sub calculate {
Link Here
|
265 |
} |
265 |
} |
266 |
$strcalc .= " GROUP BY borrowers.borrowernumber"; |
266 |
$strcalc .= " GROUP BY borrowers.borrowernumber"; |
267 |
$strcalc .= ", $colfield" if ($column); |
267 |
$strcalc .= ", $colfield" if ($column); |
268 |
$strcalc .= " ORDER BY RANK DESC"; |
268 |
$strcalc .= " ORDER BY `RANK` DESC"; |
269 |
$strcalc .= ",$colfield " if ($colfield); |
269 |
$strcalc .= ",$colfield " if ($colfield); |
270 |
$strcalc .= " LIMIT $limit" if ($limit); |
270 |
$strcalc .= " LIMIT $limit" if ($limit); |
271 |
|
271 |
|
272 |
- |
|
|