I've got a dataset, properties, which have square footage. I'd like to do a 
group and count by all square footages rounded to the nearest 100. I tried 
this:

Property.exclude(square_footage: nil).select{ ciel(square_footage / 100) * 
100 }.group_and_count(:square_footage)

This executes fine but the expression doesn't seem to be used. The 
resulting SQL is:

"SELECT \"square_footage\", count(*) AS \"count\" FROM \"properties\" WHERE 
(\"square_footage\" IS NOT NULL) GROUP BY \"square_footage\""

What's the recommended way to accomplish this sort of thing? (group and 
count an expression result).

Thanks!

Andrew

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to