---
schema_version: "1"
id: d7c676e0835541bb72d5798b8e556851b003a7b2974145976909b3773d25d7c3
title: Array Slice ([start:end])
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-slice.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-slice.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 59aa1c80bb065b58b840a8696e07bf59123d21cc455595f155d466a531da1a99
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# Array Slice (`[start:end]`)

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Returns a subarray within specified bounds from an array.

## Syntax

```sql
(<ARRAY>)[<start>:<end>]
```

## Arguments

### Required

- `<array>`: The array to slice.
- `<start>`: The starting index.
- `<end>`: The ending index.

## Returns

Returns an array that contains elements from the start index to the end index (inclusive).

## Considerations

- Both bounds are inclusive and 1-based.
- If bounds exceed the array length, the result is limited to available elements.

## Examples

### Extract Subarray

Extract elements from index 2 to 3.

```sql
SELECT (ARRAY[1, 2, 3])[2:3] AS subarray;
```

Returns `[2, 3]`, a subarray containing the elements at positions 2 and 3.

## Related Documentation

- [Array Data Type](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/array.md)
