Skip to main content

SLICE

Extracts a slice from the array by index (1-based).

Syntax

SLICE( <array>, <start>[, <end>] )

Aliases

Examples

SELECT ARRAY_SLICE([1, 21, 32, 4], 2, 3), SLICE([1, 21, 32, 4], 2, 3);

┌─────────────────────────────────────────────────────────────────┐
│ array_slice([1, 21, 32, 4], 2, 3) │ slice([1, 21, 32, 4], 2, 3)
├───────────────────────────────────┼─────────────────────────────┤
[21,32][21,32]
└─────────────────────────────────────────────────────────────────┘
Did this page help you?
Yes
No
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today