Наконец-то я смог написать решение, спасибо всем за поддержку! Специально Ашиш:)
=============================================== ============================
DECLARE
x varchar2 (2000): = NULL;
y varchar2 (4000): = NULL;
начать
for i in(select column_id,column_name,lead(column_name,1) OVER (ORDER BY column_id) next_column
from all_tab_cols where table_name='TABLE_NAME' and column_name not in ('Parameter'))
loop
if i.next_column != 'NULL' then
x := x||'NVL("'||i.column_name||'",0) as "'||i.column_name||'",NVL("'||i.column_name||'", 0)-NVL("'||i.next_column||'", 0) as "'||i.column_name||'~",';
else
x := x||'NVL("'||i.column_name||'",0) as "'||i.column_name||'"';
end if;
end loop;
y := 'create table TABLE_NAME_NEW as select Parameter,'|| x || ' from TABLE_NAME
order by Parameter';
--dbms_output.put_line('y :'||y);
execute immediate y;
END; * * 1 010
/