From: Chuck Remes <cremes.devl...@mac.com>
Date: Mon, 5 Nov 2007 21:43:23 -0600
Local: Mon, Nov 5 2007 10:43 pm
Subject: help with aggregation & group by
I have a table where I'm trying to get the average time delta for each
minute of the past X minutes. I have the SQL written and working but I'm unsure how to translate it into Sequel ruby; it may not even be possible but I thought I'd ask the list. Here's my table definition and the SQL I am running against it: class Order < Sequel::Model(:orders) select market, minute(from_unixtime(ack)) AS minute, round(avg((ack - As you may infer, the ack and created_at columns are large floating market = 'ICE' I need to do math (subtraction) on two columns in the result set and Am I best off just executing the SQL above and saving it into a You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||