select tbl_user.ID,tbl_user_info.`Name` from tbl_user left JOIN tbl_user_info on tbl_user.ID = tbl_user_info.UserID; DECLARE CONTINUE HANDLER FOR NOT FOUND SET @flag = 1; set @rownum:=0; set @rownum_plan:=0; set @flag = 0 ; drop table IF EXISTS tmp_tbl; create TEMPORARY ...
declare v_num INT DEFAULT 0; /*游标循环到末尾时给定义的常量赋值*/ declare cur_userId CURSOR FOR select userId from user_level_info where DATE_SUB(CURDATE(), INTERVAL 60 DAY) >= firstLoginDate and lv<=10 and vip=0 ; declare CONTINUE HANDLER FOR SQLSTATE '02000' SET v_dt = -1; ...