Oracle sql 使用exit跳出循环

发布时间 2023-08-09 17:26:19作者: DbWong_0918

Oracle sql 使用exit跳出循环

  loop
    select count(1)
      into p_num
      from table1 c
     where c.b = 'b'
       and c.r is null;
  
    dbms_output.put_line('123123123');
    /* if p_num > 0 then
      exit;
    end if;*/
    exit when p_num > 0;
  
  end loop;