---
schema_version: "1"
id: a40371edbf47b9bafbd5e816160d4da103d25e29624d6749123433347bdd4455
title: ARRAY_POSITIONS
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/scalar-func/array-func/array-positions.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-positions.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 489460953a23210c91204a4bdd8b5c457a49138edf53f87bd22d1ee4d3f52a7c
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `ARRAY_POSITIONS`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Returns an array of the indices of all occurrences of a specified value.

## Syntax

```sql
array_positions(<array>, <value>)
```

## Arguments

### Required

- `<array>`: The array to search.
- `<value>`: The value to find (must match array element type).

## Returns

Returns an array of integers that represents all 1-based indices where the value occurs, or an empty array if not found.

## Examples

### Find All Occurrences

Find all positions of a value that appears multiple times.

```sql
SELECT array_positions(array[1, 3, 4, 3], 3) AS positions;
```

Returns `[2, 4]`, an array of indices where 3 appears in the array.

### Value Not Found

Attempt to find positions of a value that doesn't exist.

```sql
SELECT array_positions(array[1, 3, 4, 3], 2) AS positions;
```

Returns `[]`, an empty array, because 2 isn't present in the array.

## Related Documentation

- [Array Data Type](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/array.md)
