-- Analysis of Percentage can be done using -- SUM() OVER() and SUM() OVER(ORDER BY ) -- syntax as shown below. Also shown are -- cummulative (running total for value) -- totals and percentage. -- COUNT(*) OVER() gets the total row count. WITH q_data AS ( SELECT level idx, COUNT(*) OVER() cnts, SUM(level) OVER() total FROM DUAL CONNECT BY level <= 10) SELECT idx, SUM(idx) OVER(ORDER BY idx) cum_total, ROUND(100*idx/total,4) idx_percent, ROUND(SUM(100*idx/total) OVER(ORDER BY idx),4) cum_percent, cnts total_row_cnt FROM q_data ;
56231