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

# ARRAY_SUM

Returns the sum of elements of `<array>`.

## Syntax

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

## Parameters

| Parameter | Description                                     | Supported input types      |
| :-------- | :---------------------------------------------- | :------------------------- |
| `<array>` | The array to be used to calculate the function. | Any array of numeric types |

## Return Type

The return type depends on the input type:

| Array element type          | Return type                 |
| :-------------------------- | :-------------------------- |
| `INTEGER`                   | `BIGINT`                    |
| `BIGINT`                    | `NUMERIC(38, 0)`            |
| `NUMERIC(precision, scale)` | `NUMERIC(precision, scale)` |
| `REAL`                      | `REAL`                      |
| `DOUBLE`                    | `DOUBLE`                    |

## Example

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

  | levels <span>long null</span> |
  | :---------------------------- |
  | 10                            |

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