???????7??REPEAT?????
????mysql> delimiter //
????mysql> CREATE PROCEDURE dorepeat(p1 INT)
????-> BEGIN
????-> SET @x = 0;
????-> REPEAT
????-> SET @x = @x + 1;
????-> UNTIL @x > p1 END REPEAT;
????-> END
????-> //
????Query OK?? 0 rows affected (0.00 sec)
????mysql> CALL dorepeat(1000)//
????Query OK?? 0 rows affected (0.00 sec)
????mysql> SELECT @x//
????+------+
????| @x |
????+------+
????| 1001 |
????+------+
????1 row in set (0.00 sec)
????WHILE???
????[begin_label:] WHILE search_condition DO
????statement_list
????END WHILE [end_label]
???????????????????REPEAT???????????WHILE????????????????????REPEAT??????????????????WHILE???????????????????????????????0?Σ???REPEAT??????????????????ж???????????????????1?Ρ?
???????8??WHILE?????
????REATE PROCEDURE dowhile()
????BEGIN
????DECLARE v1 INT DEFAULT 5;
????WHILEv1 > 0 DO
????...
????SETv1 = v1 - 1;
????ENDWHILE;
????END;
?????????????
???????????????MySQL5.1?????????????????????????????????????????????????????????????????Linux???μ???????crontab
?????磺
????CREATE EVENT myevent
????ONSCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
????DO
????UPDATE myschema.mytable SET mycol = mycol + 1;
???????У?
????<1>?????????CREATE EVENT?????????????
????<2>???ON SCHEDULE???????????????м??????Σ?
????<3>???DO?????????е??????????????
?????????????д??????????????????е????????????????1С??????????????±??????
?????????????????????????????
????SET GLOBAL event_scheduler = 1??
????????????????????????????????disable?????????drop????
????ALTER EVENT myevent disable;
????DROP EVENT myevent;