Showing posts with label Count In Oracle SQL. Show all posts
Showing posts with label Count In Oracle SQL. Show all posts

Wednesday, December 25, 2013

Count In Oracle SQL

Assume table name is EMPLOYEE and it has E_NAME Field.

Count In Oracle SQL  : All Records In Table



SELECT COUNT(*) FROM EMPLOYEE;

Count In Oracle SQL : All Records In Table with Head Name


SELECT COUNT(*) AS EMPLOYYE_COUNT FROM EMPLOYEE;

Count Column Records In Table


SELECT COUNT(E_NAME) FROM EMPLOYEE;

Count Distinct Column Records In Table


SELECT COUNT(DISTINCT E_NAME) FROM EMPLOYEE;

Count In Oracle SQL : Selected Records In Table


SELECT COUNT(*) FROM EMPLOYEE WHERE CONDITION E_NAME = 'BOND';

Count In Oracle SQL : Selected Records with Head Name


SELECT COUNT(*) FROM EMPLOYEE NAME_BOND WHERE CONDITION E_NAME = 'BOND';