COUNT(expression)

Description: Returns the number of rows retrieved in a SELECT statement where values of expression are not NULL. Generally used with GROUP BY clause.

Note that COUNT(*) returns the number of rows retrieved by a query, even if their values are NULL.

Examples:

SELECT city_name, COUNT(temperature)
  FROM weather
  GROUP BY city_name

returns the number of temperatures recorded, grouped by city name.

SELECT COUNT(*)
  FROM weather

returns the total number of rows in table weather.

See also: COUNT(DISTINCT)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.166.255