pkomor | 21 Jun 2012 09:11
Picon

count a grouped select

There  db(query).count(), but, what is the correct way to count the number of rows that have a grouped select, db(query).select(groupby)?

Thanks

--
Vasile Ermicioi | 21 Jun 2012 15:46
Picon

Re: count a grouped select

and how will do that in sql? and you will get the response

try

_select1 = db(query)._select(db.table.id,groupby) 
_count = db(db.table.id.belongs( _select1)).count()

--

Gmane