Count() Function with Different Parameters PLSQL/ORACLE

Count() Function  with Different Parameters


        The COUNT() function returns the number of rows that matches specified criteria.It is an aggregate function that counts the number of rows accessed in an expression

  1. SELECT COUNT(*) FROM Table_Name;

  1. Returns total number of rows in a table regardless of NULL values and duplicates.
  2. Asterisx is a typical sign of a meaning “Everything” so this function counts ALL the rows. if you want to count all the rows in a table you should use COUNT(*).

  1. SELECT COUNT(Col) FROM Table_Name;
           Return count of non-null values in column Col.
           
Returns not null occurrences. Number of records in the table regardless of NULL values and
duplicates.
If you want to count not null occurrences in a table – the best solution is
COUNT (<expression>) COUNT(1) is nothing other than COUNT(<expression>).

Post a Comment

0 Comments