Thursday, December 27, 2012

Calculating percentage of a row over total sum

You're looking for the analytical function ratio_to_report
select 
  agent,
  round(ratio_to_report(commission) over ()*100) "% Comm."
from  
  commissions;
http://dba.stackexchange.com/questions/653/calculating-percentage-of-a-row-over-total-sum

No comments:

Post a Comment