美文网首页
sql 循环写法

sql 循环写法

作者: 柒月姐姐a | 来源:发表于2021-06-25 11:08 被阅读0次
    declare 
    
      uuid varchar2(38);
    -- 游标 
      cursor cur_data is select * from bas.bas_mof_div where level_no = 1 AND MOF_DIV_CODE <> '330200000';
    begin
      for cur_row in cur_data loop
          for detail_row in (select * from pm_s_pro_est_detail where mof_div_code='330200000') loop
              for detail_cri_row in (select * from pm_s_pro_est_detail_cri cri where cri.pro_drtdtl_id = detail_row.pro_drtdtl_id and  cri.mof_div_code='330200000') loop
                uuid := detail_cri_row.pro_drtdtl_id;
                dbms_output.put_line(uuid);
              end loop;
          end loop;
      end loop;
      -- commit;
    end;
    

    相关文章

      网友评论

          本文标题:sql 循环写法

          本文链接:https://www.haomeiwen.com/subject/mnnnyltx.html