COUNT
Returns the total number of records for the specified expression.
Syntax
COUNT(expression any primitive) → bigint
- expression: The expression to evaluate the number of records. This parameter can either be * or a column name of any primitive data type. Using asterisk (*) will include rows that contain
NULL
. Specifying a column name will ignore rows haveNULL
in that column.
Examples
Aggregate function exampleSELECT COUNT(passenger_count) FROM "Samples"."samples.dremio.com"."NYC-taxi-trips"
-- 338293677
SELECT "trip_distance_mi",
COUNT("total_amount") OVER(PARTITION BY "trip_distance_mi") "count_total_amount"
FROM "Samples"."samples.dremio.com"."NYC-taxi-trips"
LIMIT 1
-- trip_distance_mi, count_total_amount
-- 0.06, 61900