??????3?????????÷??(tb_os_point)????????????????μ??????????ID??

???????????????(5)?????????????÷????????

 ???????У? ??? ?? ?????????????????????????? ?????????????????????? ??????? ?????????е???????? ?????????е???????? ????????????÷??????????????tb_os_log???????????????????????????tb_os_point???total_point??Ρ?

????????????????????????????(tb_os_test)????4????????????????is_pass????0????????????????is_pass????1?????????????????

 ??????????洢?????д????????????????洢???????

????CREATE PROCEDURE testStat(IN start_date DATE?? IN end_date DATE?? IN error_allow DOUBLE)

????//?????????????????????????????????????

????BEGIN

????DECLARE uc_id INT DEFAULT 0;//???????ID

????DECLARE done_num INT DEFAULT 0;//????????

????DECLARE do_num INT DEFAULT 0;//???????

????DECLARE ratio DOUBLE DEFAULT 0;//?????

????DECLARE r_max DOUBLE DEFAULT 0;//????????е???????

????DECLARE r_min DOUBLE DEFAULT 100;//????????е???????

????DECLARE point_test DOUBLE DEFAULT 0;//?????????????

????DECLARE point_tested DOUBLE DEFAULT 0;//????????????????

????DECLARE point_error DOUBLE DEFAULT 0.1;//???

????DECLARE uc_info CURSOR for SELECT ucid FROM tb_os_point;

????DECLARE CONTINUE HANDLER FOR SQLSTATE ’02000′ SET uc_info=NULL;

????OPEN uc_info;

????FETCH uc_info INTO uc_id;

????WHILE uc_id IS NOT NULL DO//?????????????????м????

????SELECT count(*) INTO do_num //??????????

????FROM tb_os_log

????WHERE visit_date>start_date AND vistit_date SELECT count(*) INTO done_num //????????????

????FROM tb_os_log ;

????WHERE visit_date>start_date AND vistit_date SET ratio = done_num / do_num;