mysql游标遍历

 declare m_cur cursor for select col from tx_strlist;-- tx_str_split :执行存储过程后的临时表
   declare continue handler for not found set  _done=true;

  -- 打开游标
    open m_cur;

   -- 一层嵌套循环
    repeat
    fetch m_cur into _cur;
        if not _done then

  -- 写逻辑

  end if;
    
    until _done end repeat;  --直到循环读取结束
    close m_cur;-- 关闭游标

原文地址:https://www.cnblogs.com/w-pengchao/p/9675433.html