For AI agents: an index of this documentation is at https://developer.rippling.com/llms.txt. Public pages have a Markdown version at the same URL with .md added.

Skip to main content
index

ARRAY_AGG() Function

Use with AI:Rippling AI ChatGPT Claude Cursor

Description​

Aggregates (collects) values from a group and returns a single array

Syntax​

ARRAY_AGG(expression [ORDER BY sort_expression] [LIMIT count])

Parameters​

ParameterDescriptionData TypeRequired
expressionColumn or expression to evaluateAnyYes

Notes​

  • Returns an empty array if the input is empty
  • Returns only non-null values
  • The array type depends on the input type (Integer[], Text[], etc.)
  • Use WITHIN GROUP (ORDER BY ...) to control the order of values in the resulting array.
  • When used as a window function, include an OVER (...) clause.
  • To filter rows based on a window calculation, use QUALIFY instead of WHERE.

Example​

SELECT
ARRAY_AGG(full_name) WITHIN GROUP (ORDER BY full_name)
FROM
rippling.employee.Employee
GROUP BY
department;