# GREATEST

Returns the maximum value from multiple columns. This function is similar to `MV_MAX` but is designed to operate on multiple columns simultaneously.

## Syntax

`GREATEST(first, rest)`

### Parameters

#### `first`

The first column to evaluate.

#### `rest`

The remaining columns to evaluate.

## Examples

Finding the maximum value between two columns

```esql
ROW a = 10, b = 20
| EVAL g = GREATEST(a, b)
```

This example evaluates the maximum value between columns `a` and `b`, resulting in `g = 20`.

## Notes

- When applied to `keyword` or `text` fields, the function returns the last string in alphabetical order.
- When applied to `boolean` columns, the function returns `true` if any of the values are `true`.
