I want to create a query that will generate histogram buckets: ds = Email.dataset.select(Sequel.function(:count).*.as(:total)) start = 0 interval = 1
while start < 10 do end_of_bucket = start + interval bucket_count = Sequel.function(:count).*.filter do (value_column >= start) & (value_column < end_of_bucket) end ds = ds.select_more(bucket_count) start = end_of_bucket end ds.all But `start` and `end_of_bucket` all get evaluated at the end, so each column selection is `COUNT(*) FILTER WHERE (value_column >= 10 AND value < 10)`. How can I force immediately evaluation of the block passed to `filter` to get the desired result? (I realize this is more of a Ruby question than a Sequel specific question.) -- 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 https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
