`unnest`

Data 360 Query Guide, mirrored from developer.salesforce.com: **Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

markdownreferencev10W23-NTA2guide: data-cloud-query-guidestage: referencetrust: officialsource: developer.salesforce.comservice: data360interface: sql`unnest`Data 360Data CloudData 360 Query Guide

Created 23 Oct 2026 · Modified 23 Oct 2026 · 1 version

Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/unnest.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

unnest

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Expands the elements of one or more arrays into a set of rows.

  • <array>: The array to expand.
  • ...: Additional arrays to expand in lock-step.

Returns a set of rows, each containing one element from the array(s). If multiple arrays are provided, they are expanded in lock-step. If the arrays aren’t all the same length, the shorter ones are padded with NULL values.

Results:

day
Mon
Tue
Wed
Thu
Fri

The WITH ORDINALITY clause instructs unnest to also number the generated rows. Thereby, we know which element occured at which position in the original array.

Results:

dayordinality
Mon1
Tue2
Wed3
Thu4
Fri5

You can also call unnest with multiple array parameters. In this case, the arrays are expanded in lock-step. If the arrays aren’t all the same length, the shorter ones are padded with NULL values.

Results:

nametask
Monramp up
Tuework
Wedwork
Thuwork
Friwrap up
SatNULL
SunNULL

Read this document as markdown — the same bytes an agent receives.