declare
s_sql varchar2(200);
.....
s_sql := 'select ' || v_columnname || ' NTILE(10) over (order by ' || v_columnname || ' desc) as DECILE_RANK from table1 where ' || v_columnname || ' is not null order by DECILE_RANK desc;'
execute immediate s_sql;
.....
|