In the table this is taken from, activo is either 1 or 0. In the table
which is legacy MySQL it is defined as INT(1)
These are the results I am getting:
In [46]: db(db.direccionesgrupo.activo == 1).count()
Out[46]: 58L
In [48]: a =db().select(db.direccionesgrupo.activo.sum())
In [49]: print a
-------> print(a)
SUM(direccionesgrupo.activo)
112
In [51]: b = db(db.direccionesgrupo.activo==1).select('count(*)')
In [52]: print b
-------> print(b)
count(*)
58
The correct value is the one done with the aggregate sum().
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.