MIN

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the minimum value of an expression across all input values.

Syntax

min(<expression>)

Arguments

Required

  • <expression>: An expression of any comparable type.

Returns

Returns the same type as the argument. Returns NULL if no rows are selected.

Considerations

  • NULL values are ignored in the calculation.
  • Works with numeric types, strings, dates, and other comparable types.
  • For strings, returns the lexicographically smallest value.

Examples

Find Minimum Value

Get the lowest price.

SELECT min(price) AS lowest_price
FROM products;

Minimum by Group

Find the minimum value per group.

SELECT category, min(price) AS min_price
FROM products
GROUP BY category;

Minimum Date

Find the earliest date.

SELECT min(order_date) AS first_order
FROM orders;

Related Documentation