Total Pageviews

COUNT() in SQL Server

Some considerable point about COUNT() in SQL Server :-
  • It comes under aggregate function.
  • It returns number of item in group.
  • The return type of COUNT() is "INT".
  • COUNT(*) returns the number of values in a group, doesn't matter values includes "NULL" or duplicates.
  • COUNT(<ColumnName>) returns the number of nonnull values.
  • COUNT(DISTINCT <ColumnName>) returns the number of unique, non-null values.
Lets have an example :-




No comments:

Post a Comment