Merge pull request #1113 from timnyborg/patch-6

Fix grid count when using groupby on MSSQL
This commit is contained in:
mdipierro
2015-12-04 10:41:36 -06:00

View File

@@ -2079,7 +2079,7 @@ class SQLFORM(FORM):
## if it's not an integer
if cache_count is None or isinstance(cache_count, tuple):
if groupby:
c = 'count(*)'
c = 'count(*) AS count_all'
nrows = db.executesql(
'select count(*) from (%s) _tmp;' %
dbset._select(c, left=left, cacheable=True,