Oracle CUME_DIST Function


/ Published in: SQL
Save to your folder(s)

A few examples of the CUME_DIST function.


Copy this code and paste it in your HTML
  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;

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.