You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.
SELECT COUNT(#<MetaWhere::Function:0x106fd0230>) AS count_metawhere_function_0x106fd0230, county AS county, age AS age FROM `clients` GROUP BY county,age
I've worked around it by using a COUNT() sql function in the select, but it's sloppier and forces me also to select the other fields and to do a map:
Addendum: .count() works if I'm not performing the :year function. So this works:
Client.group(:county,:gender).count
SELECTCOUNT(*) AS count_all, county AS county, gender AS gender FROM`clients`WHERE`clients`.`abstract`=0AND`clients`.`active`=1AND`clients`.`referral_date`<='2011-06-30'AND (`clients`.`discharge_date`>='2011-04-01'OR`clients`.`discharge_date` IS NULL) GROUP BY county,gender ORDER BY last, first
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
First off, I love, love, love MetaWhere!
Second, I'm trying to return a count with groupings and SQL functions:
... works great. But adding .count to the end:
I've worked around it by using a COUNT() sql function in the select, but it's sloppier and forces me also to select the other fields and to do a map:
This works; I'm just wondering if I ran into a bug or I'm not using it right. Thanks!
The text was updated successfully, but these errors were encountered: