saladi
saladi

Reputation: 3253

count rows in each group

How would one implement count with a group by operation using the PHP activerecord ORM? I know that I can do this directly via custom_sql, but I am looking for a way to do this more directly through the ORM.

A sample SQL statement of the equivalent operation:

SELECT grade_level, COUNT(*) FROM SCHOOL
GROUP BY grade_level

Upvotes: 0

Views: 35

Answers (0)

Related Questions