Merge pull request #1113 from timnyborg/patch-6
Fix grid count when using groupby on MSSQL
This commit is contained in:
+1
-1
@@ -2079,7 +2079,7 @@ class SQLFORM(FORM):
|
|||||||
## if it's not an integer
|
## if it's not an integer
|
||||||
if cache_count is None or isinstance(cache_count, tuple):
|
if cache_count is None or isinstance(cache_count, tuple):
|
||||||
if groupby:
|
if groupby:
|
||||||
c = 'count(*)'
|
c = 'count(*) AS count_all'
|
||||||
nrows = db.executesql(
|
nrows = db.executesql(
|
||||||
'select count(*) from (%s) _tmp;' %
|
'select count(*) from (%s) _tmp;' %
|
||||||
dbset._select(c, left=left, cacheable=True,
|
dbset._select(c, left=left, cacheable=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user