diff --git a/VERSION b/VERSION index 7245720d..d9beb281 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.5-stable+timestamp.2013.04.03.16.48.32 +Version 2.4.5-stable+timestamp.2013.04.04.21.10.38 diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index b110b5d8..fac59c5a 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -2122,7 +2122,10 @@ class SQLFORM(FORM): dbset = dbset(subquery) try: if left or groupby: - c = 'count(*)' + if groupby: + c = 'count(distinct %s)' % str(groupby) + else: + c = 'count(*)' nrows = dbset.select(c, left=left, cacheable=True, groupby=groupby).first()[c] elif dbset._db._adapter.dbengine=='google:datastore':