sql中可以使用with
plsql中  可以 使用   with 嗎?
是不是不可以使用啊? 

解决方案 »

  1.   

    可以的,是with as 吗SQL> declare a int;
      2  begin
      3  with tmp as (select * from test where rownum <=20)
      4  select count(*) into a from a;
      5  dbms_output.put_line(a);
      6  end;
      7  /
    19PL/SQL 过程已成功完成。SQL>
      

  2.   

    如果  不用 into  語句      是不是不能用呢 ?
      

  3.   


    可是編譯不過噢 ?    加上into  就能編譯過~~
      

  4.   

    select into相当于赋值.
    不能在pl/sql里用select返回结果集,可以使用cursor. 
      

  5.   


    這個我了解 我想這樣 您看可以嗎?
    with temp_a  as(select ... )
    if ...  then  ......這樣行不通吧?基本就是把這個with當作一個臨時table  不可以嗎?
      

  6.   


    用游标解决for rec in (select ... )
    loop
      if ... then ... end if;
    end loop;
      

  7.   

    不知道with    最大的用途是什么呢 ?
    不能當作一個臨時表來用嗎?