0

I am reading an article on sitepoint - http://www.sitepoint.com/how-to-create-mysql-events/ on the subject of mysql events and i came across this point when you can schedule

And i quote

Run at specific intervals during a specific period: EVERY n [HOUR|MONTH|WEEK|DAY|MINUTE] STARTS date ENDS date e.g. EVERY 1 DAY STARTS CURRENT_TIMESTAMP + INTERVAL 1 WEEK ENDS ’2012-01-01 00:00.00′

I am having a hard time understanding what the author means.Can anyone help me out?.

1 Answers1

0

The author is just giving an example, how a statement might be built up to create an event that starts and runs at some point regularly.

EVERY n /*give here a number*/
[HOUR|MONTH|WEEK|DAY|MINUTE] /*choose here one of those values*/
STARTS date /*name a date here...*/
ENDS date /*...and here*/

The author also supplies an example:

EVERY 1 DAY 
STARTS CURRENT_TIMESTAMP + INTERVAL 1 WEEK 
ENDS '2012-01-01 00:00.00'

In the example the query that is specified in the event is executed every day at the same time the event is created but one week later and ends at 2012-01-01.

Here's the official manual page with a lot more examples. 13.1.11 CREATE EVENT Syntax

I personally find the official manual the best to learn about MySQL. It's very well written. Give it a try :)

fancyPants
  • 50,732
  • 33
  • 89
  • 96