Skip to main content
Version: 24.3.x

Categories: Aggregate, Window

MIN

Returns the minimum value among the non-NULL input expressions.

Syntax

MIN(expression any primitive) → same as input

  • expression: Input expression.

Examples

Aggregate function example
SELECT MIN("total_amount") 
FROM "Samples"."samples.dremio.com"."NYC-taxi-trips"
-- -1430.0

MIN(expression any primitive) → same as input

  • expression: Input expression.

Examples

Window function example
SELECT "trip_distance_mi", 
MIN("total_amount") OVER(PARTITION BY "trip_distance_mi") "min_total_amount"
FROM "Samples"."samples.dremio.com"."NYC-taxi-trips"
LIMIT 1
-- trip_distance_mi, min_total_amount
-- 0.06, -52.5

Usage Notes

For information about the data types that are supported in Dremio, see Data Types.