参考:Re: Temp Table in Select of a Cursor 方法一: delimiter $$ create procedure test_temp() begin drop temporary table if exists tmp; create temporary table tmp(id int unsigned); ); begin -- (主要增加Begin与End) declare v_id int unsigned; declare csr1 cursor f…