MySQL Forums
Forum List  »  General

Re: Calculate sum between rows when time changes
Posted by: Peter Brawley
Date: March 02, 2015 11:18AM

> timestamp in the csv files are in the wrong format (20090501 00:00:00.833)

Yes, you'll need something like ...

timestamp( concat( left(timestamp,4), '-', substr(timestamp,5,2), '-', substr(timestamp,7,2), right(timestamp,13 ) ) );

> would be over the course of more than one day,

Makes the calculation more or less meaningless, but if that's what's desired, you'll need to run a script on the table to extract the intervals, and put those in a calendar table.

Options: ReplyQuote




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.