MYSQL procedure

没怎么接触过mysql procedure,今天建个calendar表还磨磨唧唧的,记录一下:

 


CREATE
PROCEDURE `new_procedure` (start_date DATA,end_date DATE) BEGIN declare crt_date DATE; set crt_date = start_date; WHILE crt_date < end_date DO   insert into table values(crt_date);   set crt_date = adddate(crt_date,interval 1 day); END WHILE END

 

posted @ 2015-05-07 17:07  西番莲果汁  阅读(173)  评论(0编辑  收藏  举报