Hi everyone,

I've got a project where I record measurement data for various objects in 15
minute intervals. A simplified table structure could look like:

- objectid Integer
- dt       DateTime
- measurementA Integer
- measurementB Integer
- measurementC Integer

I've got a few thousand different unique objectid's which report
measurements every 15 minutes. What I need to do is to figure out, for every
day, which hour has the highest value summed up across all objectid's.

The first step is just to get the time stamp but later I'd like to retrieve
the sum(measurementX) at that particular hour for all objects for a series
of dates.

Is there a good way to do this? It's not so important that the peak hour is
calculated on an hour boundary (given one value every 15 min).

A final question... I filter the objects I wish to retrieve data for by
means of a WHERE objectid IN (1,2,3,4, ...)

Supposed now this IN list contain a number of entries, from a single up to a
few thousand, would it be faster to insert these values into a temporary
table and then do a JOIN operation during the select?

Thanks in advance,

Niklas


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to