MySQL Forums
Forum List  »  Triggers

Re: Triggers
Posted by: Peter Brawley
Date: July 24, 2019 04:30PM

> insert data from table 1 into another table (table 2)
> however I wish to average the values over a 24 hour period

Average values of what?

> therefore allowing me to reduce data within stored within table 2
> to form am archive for the data for a period of > 12 months.

Not nearly enough info for designing a Trigger ...

1 write out every step in the logic

2 translate the result of #1 into pseudocode

3 translate #2 into SQL

In order to help, we need to start with the result of step 1.

> Timestamps within my table presently are shown as YYYY-MMM-DD 00:00:000

Unless it just happens to be the case that all stored events occurred exactly at midnight, those are invalid timestamps.

Options: ReplyQuote


Subject
Views
Written By
Posted
989
July 24, 2019 03:09PM
Re: Triggers
537
July 24, 2019 04:30PM


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.