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

# VECTOR_ADD

## VECTOR\_ADD

Returns an array that is the sum of two input arrays.

## Syntax

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

## Parameters

| Parameter | Description                                   | Supported input types                                                 |
| :-------- | :-------------------------------------------- | :-------------------------------------------------------------------- |
| `<array>` | The first array in the addition calculation.  | Any array of [numeric data types](/reference-sql/data-types#numeric). |
| `<array>` | The second array in the addition calculation. | Any array of [numeric data types](/reference-sql/data-types#numeric). |

## Notes

Both input `ARRAY` arguments must have the same number of elements.

## Return Type

`VECTOR_ADD` returns a result of type `ARRAY(BIGINT)` if the elements of `<array>` are of type `INT`, and returns a result of type `ARRAY(DOUBLE PRECISION)` if the elements are of type `REAL`. For other element types, `VECTOR_ADD` returns a result that matches the original element type, or follows Firebolt's [type conversion](/reference-sql/data-types#type-conversion) rules to convert them to compatible data types.

## Examples

**Example**

The following code example adds the two vectors, `[1, 2, 5]` and `[3, 4, -2]`, by computing `1+3`, `2+4`, and `5+(-2)`, which yields `[4, 6, 3]`:

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

  | res <span>array(long)</span> |
  | :--------------------------- |
  | \['4', '6', '3']             |

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