我在 mysql 中有 2 个游标,第二个游标应该在每次第一次游标迭代时运行,而无需再次打开它。任何想法?在此先感谢您:-
DECLARE email_not_found INT DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET email_not_found = 1;
open cur1;
open cur2;
REPEAT
FETCH cur1 INTO s1;
REPEAT
FETCH cur2 INTO s2;
if s1=s2
do something.
UNTIL email_not_found=1 END REPEAT;
UNTIL email_not_found=1 END REPEAT;
close cur1;
close cur2;