> ## 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 ARRAY_MAX function

# ARRAY_MAX

Returns the maximum element in an array.

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
ARRAY_MAX(<array>)
```

## Parameters

| Parameter | Description                                  | Supported input types |
| :-------- | :------------------------------------------- | :-------------------- |
| `<array>` | The array or array-type column to be checked | `ARRAY`               |

## Return Type

Same as the element type of the array.

## Example

The following example calculates the maximum number in the `levels` array:

<div className="query-window">
  ```
  SELECT ARRAY_MAX([1, 2, 3, 4]) AS levels;
  ```

  | levels <span>int null</span> |
  | :--------------------------- |
  | 4                            |

  <p><span>Rows: 1</span><span>Execution time: 5.14ms</span></p>
</div>
