mysql--Timer function + Process Demo

Source: Internet
Author: User

--Function--Set the time zone set time_zone = ' ";--turn on event Scheduler set GLOBAL Event_scheduler = 1;  Drop event if exists commission_zjdj_a_every_hours; # set delimiter to ' $$ ' DELIMITER $$ Create event commission_zjdj_a_every_hours on schedule every 1 HOUR starts ' 2018-06-24 23:59: The "DO Begin" Call Proc_zjdj_a_commission (); End $$ # Sets the statement separator back to '; ' DELIMITER; --Process # # # #获取当天有效的资金对接A岗一次打包数据, keep a drop PROCEDURE IF EXISTS proc_zjdj_a_commission on the day; CREATE PROCEDURE proc_zjdj_a_commission () Begindeletefromreport_statistics_commission_inquirywheretype = 2AND Date_ Format (count_time, '%y-%m ') = Date_format (now (), '%y-%m '), #一次打包-to-money docking A-gang insert INTO ' report_statistics_commission _inquiry ' (' user_id ', ' order_code ', ' execute_time ', ' task_code ', ' count_time ', ' type ', ' ext1 ', ' ext2 ', ' ext3 ') Selectreceive_id,order_code,finish_time, Task_code,now (), 2,null,null,nullfrommy_taskwhere ' status ' = 2AND Task_code = ' t_ycdb_0004 ' #排除重复订单AND order_code not in (Selectorder_codefromreport_statistics_commission_inquirywheretype = 2) GROUP by order_code; END;

  

mysql--Timer function + Process Demo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.