??????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;