COUNT_DISTINCT

Description

Syntax

COUNT_DISTINCT(expr)

The number of rows used to return the required number, or the number of non-NULL rows

example

  1. MySQL > select count_distinct(query_id) from log_statis group by datetime;
  2. +----------------------------+
  3. + 124. Calculate (`query `uid') separately;
  4. +----------------------------+
  5. | 577 |
  6. +----------------------------+

keyword COUNT_DISTINCT,COUNT,DISTINCT