Product Solutions Support
Try MemSQL

COUNT

Aggregate function. Counts the number of rows passed in. If the value of a given item is NULL, the row is not counted.

COUNT ( [DISTINCT] expression )

Arguments

Return Type

An integer.

Examples

memsql> select count(*) from people;
+----------+
| count(*) |
+----------+
|     5000 |
+----------+

memsql> select count(middle_name) as middles from people;
+----------+
|  middles |
+----------+
|     1238 |
+----------+

memsql> select count(DISTINCT middle_name) as middles from people;
+----------+
|  middles |
+----------+
|      213 |
+----------+
Was this article useful?