count(*):
It selects all the columns in
the table and then count the rows in a table
Example:select count(*) from emp;
count(1):
It selects the first column
from the table and then count the rows and including null values also.
Example:select count(1) from emp;
count(column name):
It select the column and then
count all the rows except null values
Example:select count(empno) from emp;
count(distict column name):
It will count the rows
in column with distinct values
Example: select count( distinct empno) from emp;
No comments:
Post a Comment