Skip to main content
array_repeat returns an array containing a given element repeated a specified number of times.

Syntax

Parameters

  • element: The element to be repeated can be any data type supported by the database.
  • count: The number of repetitions, of type INT.

Return value

The data type of the return value is the ARRAY type of element.

Usage notes

  • When count is less than 1, an empty array is returned.
  • When the element parameter is NULL, the result is an array consisting of count NULLs.
  • When the count parameter is NULL, the result is NULL.

Examples

Example 1:
Example 2:
Example 3:
Example 4:
Example 5: