MySQL Forums
Forum List  »  Oracle

Aggregation for a timewindow
Posted by: Priyanka shekhawat
Date: June 19, 2008 12:37PM

I am new to mysql. Can somebody please help me by converting this ORACLE query to mysql?

There are two columns in a table (experiment). The dttm column is date data type and qty column is integer. I want to sum up the qty value for the interval of first 10 minutes and next 10 minutes etc etc.

select trunc(dttm,'hh24') +
(trunc(to_char(dttm,'mi')/10)*10)/24/60, sum(qty)
from experiment
group by trunc(dttm,'hh24') + (trunc(to_char(dttm,'mi')/10)*10)/24/60
order by trunc(dttm,'hh24') + (trunc(to_char(dttm,'mi')/10)*10)/24/60;

What would be the equivalent SQL in mysql?

thank and Best Regards,
Priyanka

Options: ReplyQuote


Subject
Views
Written By
Posted
Aggregation for a timewindow
4166
June 19, 2008 12:37PM


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.