for x in 
    ( select rpad( a.name, 30 ) || 
        to_char( b.value-a.value, '9,999,999' ) || 
        to_char( c.value-b.value, '9,999,999' ) || 
        to_char( ( (c.value-b.value)-(b.value-a.value)), '9,999,999' ) data
       from run_stats a, run_stats b, run_stats c
      where a.name = b.name
         and b.name = c.name
         and a.runid = 'before'
         and b.runid = 'after 1'
         and c.runid = 'after 2'
         and (c.value-a.value) > 0
         and abs( (c.value-b.value) - (b.value-a.value) ) 
               > p_difference_threshold
       order by abs( (c.value-b.value)-(b.value-a.value))
    ) loop
        dbms_output.put_line( x.data );
    end loop;show error 
sql statement ignored 红色行

解决方案 »

  1.   

    帮楼主顶一下.
    好像rpad函数还有个填充参数吧,rapd(a.name,'*',30)不知道对不对,初学
      

  2.   

    rpad函数形式是这样的 select rpad('$',5,'%') from dual;
      

  3.   

    楼主复制的Tomas Kyte的9i-10g编程艺术里的代码哈
    应该没问题的,主要看一下有没特殊的不可见字符导致编译错误
      

  4.   

    select rpad( a.name, 30 ) || 
      to_char( b.value-a.value, '9,999,999' ) ||  
      to_char( c.value-b.value, '9,999,999' ) ||  把后面的||都去掉.
    你这个又不是动态sql,不需要用连接符
      

  5.   

    顶一下
         oracle QQ群:54775466
                    欢迎大家来一起探讨。