# min()

`min(col [, ...cols])` returns the minimum value of the provided column(s) in the input datastream. If multiple columns are provided, their values are lexically ordered as a tuple—see [max()](https://docs.scanner.dev/scanner/using-scanner-complete-feature-reference/querying-and-analysis/aggregation-functions/max)—except `null` values are considered the greatest variant instead of the least.

### Note

`min(a, b)` is not the same as `min(a), min(b)`. To get the minimum values of multiple columns, run a `stats` query, e.g. `stats min(a), min(b)`. See [stats()](https://docs.scanner.dev/scanner/using-scanner-complete-feature-reference/querying-and-analysis/aggregation-functions/stats) for more information.

## Returns

A table with one row and one column for each `col` provided, called `@q.min[i]`, where `i` is the index of `col` in the arguments. If only one `col` was provided, the column is called `@q.min`.

## Example

Return the minimum elapsed time for a request in the **checkout\_api** service.

```python
%ingest.source_type: "kubernetes"
and kubernetes.container_name: "checkout_api"
| min(log.%kv.elapsed_ms)
```
