---
title: min_n() | Tiger Data Docs
description: Find the smallest values in a set of data
---

Since [1.16.0](https://github.com/timescale/timescaledb-toolkit/releases/tag/1.16.0)

Construct an aggregate that keeps track of the smallest values passed through it.

## Arguments

The syntax is:

```
min_n(
    value BIGINT | DOUBLE PRECISION | TIMESTAMPTZ,
    capacity BIGINT
) MinN
```

| Name       | Type                                      | Default | Required | Description                          |
| ---------- | ----------------------------------------- | ------- | -------- | ------------------------------------ |
| `value`    | BIGINT \| DOUBLE PRECISION \| TIMESTAMPTZ | -       | ✔        | The values passed into the aggregate |
| `capacity` | BIGINT                                    | -       | ✔        | The number of values to retain.      |

## Returns

| Column | Type | Description                                                                                                           |
| ------ | ---- | --------------------------------------------------------------------------------------------------------------------- |
| min\_n | MinN | The compiled aggregate. Note that the exact type is `MinInts`, `MinFloats`, or `MinTimes` depending on the input type |
