MySQL Forums
Forum List  »  General

Re: averaging with multiple ranges
Posted by: Chad Bourque
Date: December 07, 2009 09:10AM

ian,

Break your time down into days, hours, and half hours, then group by them:

select date(date_stamp) dateValue, concat(hour(date_stamp), ':',
    case when minute(date_stamp) > 30 then '30' else '00' end) timeValue,
    format(10 * log10(avg(pow(10, (meas / 10)))), 1) AVmeas
  from timeHistory
  group by dateValue, timeValue;

You can still add whatever where clause you want.

HTH,
Chad

Options: ReplyQuote


Subject
Written By
Posted
Re: averaging with multiple ranges
December 07, 2009 09:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.