Posted By

bbrumm on 03/27/17


Tagged

sql Oracle


Versions (?)

Oracle CUME_DIST Function


 / Published in: SQL
 

URL: http://www.databasestar.com/oracle-cume_dist

A few examples of the CUME_DIST function.

  1. SELECT CUME_DIST(300) WITHIN GROUP (ORDER BY fees_paid) AS cume_dist_test
  2. FROM student;
  3.  
  4. SELECT CUME_DIST(300, 200) WITHIN GROUP (ORDER BY fees_paid, fees_required) AS cume_dist_test
  5. FROM student;
  6.  
  7.  
  8. SELECT first_name, last_name, fees_paid,
  9. CUME_DIST() OVER (ORDER BY fees_paid) AS cume_dist_test
  10. FROM student;
  11.  
  12.  
  13. SELECT first_name, last_name, fees_paid,
  14. CUME_DIST() OVER (PARTITION BY address_state ORDER BY fees_paid) AS cume_dist_test
  15. FROM student;

Report this snippet  

You need to login to post a comment.