What is the difference between COUNT (*) and COUNT(Column Name)?


COUNT(*) – Returns the total number of records in a table (Including NULL valued records).

COUNT(Column Name) Returns the total number of Non-NULL records. It means that, it ignores counting NULL valued records in that particular column.


In the below screenshot, LastName of EmployeeID 3 is NULL. So It will not be counted when we are counting records on the basis of LastName (i.e. COUNT(LastName)).

Count() VS COUNT(ColumnName)

Latest Comments
  1. Suresh Kumar patra

    count(*)- Return the number of rows in a table that satisfy the criteria of the select statement.

    count- Return the number of non-null values in the column identified by exper.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.