Skip to main content
On this page

Kater SQL Functions Aggregations

KATER__MIN

The smallest value of the field.

Family: Aggregations

Syntax

KATER__MIN(field)

Arguments

ArgumentDescription
fieldThe field to aggregate.

Returns

A value of the field’s own type. The field menu writes the @format of the field it reads beside it, or @format number(2) where that field has none and can have decimals.

Usage notes

  • On a date, it is the earliest. On text, it is the first in the warehouse’s sort order.
  • Empty values are left out.

Example

This Sandbox query reads the sample shop’s orders. The table shows the rows that Kater gave.

SELECT
orders.region AS "Region",
KATER__MIN(orders.order_date) AS "First Order"
FROM kater_dataset.orders AS orders
GROUP BY
orders.region
ORDER BY
1
RegionFirst Order
AMER2025-01-01
APAC2025-01-02
EMEA2025-01-02
LATAM2025-01-01
null2025-01-14

Compiles to

The call compiles to the same SQL on DuckDB and on Snowflake.

MIN(orders.order_date)

See also