COUNT

Description

Syntax

COUNT([DISTINCT] expr)

Number of rows used to return the required rows

example

  1. MySQL > select count(*) from log_statis group by datetime;
  2. +----------+
  3. | count(*) |
  4. +----------+
  5. | 28515903 |
  6. +----------+
  7. MySQL > select count(datetime) from log_statis group by datetime;
  8. +-------------------+
  9. | count(`datetime`) |
  10. +-------------------+
  11. | 28521682 |
  12. +-------------------+
  13. MySQL > select count(distinct datetime) from log_statis group by datetime;
  14. +-------------------------------+
  15. | count(DISTINCT `datetime`) |
  16. +-------------------------------+
  17. | 71045 |
  18. +-------------------------------+

keyword

COUNT