> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference material for MIN function

# MIN OVER

Returns the minimum value within the requested window.

For more information on usage, please refer to [Window Functions](/reference-sql/functions-reference/window).

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
MIN( <expression> ) OVER ( [ PARTITION BY <partition_by> ] )
```

## Parameters

| Parameter        | Description                                       | Supported input types |
| :--------------- | :------------------------------------------------ | :-------------------- |
| `<expression>`   | A value used for the `MIN` function               | Any                   |
| `<partition_by>` | An expression used for the `PARTITION BY` clause. | Any                   |

## Example

The example below shows each player's score alongside the lowest score in their level. Unlike a regular `MIN()` aggregation, the window function keeps one row per player while also showing the partition minimum.

<div className="query-window">
  ```
  SELECT
      nickname,
      level,
      current_score,
      MIN(current_score) OVER (PARTITION BY level) AS lowest_score
  FROM
      (VALUES
          ('kennethpark', 9, 76),
          ('sabrina21', 9, 90),
          ('burchdenise', 10, 79),
          ('ymatthews', 10, 85),
          ('rileyjon', 10, 80)
      ) AS t(nickname, level, current_score)
  ORDER BY level, nickname;
  ```

  | nickname <span>text</span> | level <span>int</span> | current\_score <span>int</span> | lowest\_score <span>int null</span> |
  | :------------------------- | :--------------------- | :------------------------------ | :---------------------------------- |
  | kennethpark                | 9                      | 76                              | 76                                  |
  | sabrina21                  | 9                      | 90                              | 76                                  |
  | burchdenise                | 10                     | 79                              | 79                                  |
  | rileyjon                   | 10                     | 80                              | 79                                  |
  | ymatthews                  | 10                     | 85                              | 79                                  |

  <p><span>Rows: 5</span><span>Execution time: 1.81ms</span></p>
</div>
