Q.What is the difference between count(Column Name) and count(*)?
Count(Column Name)- It returns the total number of rows in a table excluding NULL.
Count(*)- It returns the total number of rows in a table including NULL.
Let us consider a below 'Customer' table. Column 'ProductId' of this table has two NULL values.
Count(Column Name)- It returns the total number of rows in a table excluding NULL.
Count(*)- It returns the total number of rows in a table including NULL.
Let us consider a below 'Customer' table. Column 'ProductId' of this table has two NULL values.
![]() |
| Customer Table |
