Oracle COUNT Function


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

A few examples of the COUNT function.


Copy this code and paste it in your HTML
  1. --COUNT
  2.  
  3. SELECT COUNT(*)
  4. FROM student;
  5.  
  6.  
  7. SELECT COUNT(DISTINCT gender)
  8. FROM student;
  9.  
  10.  
  11.  
  12. SELECT DISTINCT COUNT(gender)
  13. FROM student;
  14.  
  15.  
  16. SELECT gender, COUNT(*)
  17. FROM student
  18. GROUP BY gender;
  19.  
  20.  
  21.  
  22. SELECT COUNT(*)
  23. FROM student
  24. WHERE fees_paid >= 100;
  25.  
  26.  
  27.  
  28.  
  29. SELECT gender, COUNT(*)
  30. FROM student
  31. WHERE fees_paid >= 100
  32. GROUP BY gender;

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.