Movatterモバイル変換


[0]ホーム

URL:


Categories:

Semi-structured and structured data functions (Array/Object)

ARRAY_CAT

Returns a concatenation of two arrays.

Syntax

ARRAY_CAT(<array1>,<array2>)
Copy

Arguments

array1

The source array.

array2

The array to be appended toarray1.

Returns

An ARRAY containing the elements fromarray2 appended after the elements ofarray1.

Usage notes

  • If you are passing in semi-structured ARRAYs, both arguments must be of ARRAY type or VARIANT containing an array.

  • If you are passing in structured ARRAYs, the function returns an ARRAY of a type that can accommodate both input types.

  • If either argument is NULL, the function returns NULL without reporting any error.

Examples

This example shows how to useARRAY_CAT():

Create a simple table and data:

CREATETABLEarray_demo(IDINTEGER,array1ARRAY,array2ARRAY);
Copy
INSERTINTOarray_demo(ID,array1,array2)SELECT1,ARRAY_CONSTRUCT(1,2),ARRAY_CONSTRUCT(3,4);
Copy

Execute the query:

SELECTARRAY_CAT(array1,array2)FROMarray_demo;+---------------------------+| ARRAY_CAT(ARRAY1, ARRAY2) ||---------------------------|| [                         ||   1,                      ||   2,                      ||   3,                      ||   4                       || ]                         |+---------------------------+
Copy

Alternative interfaces


[8]ページ先頭

©2009-2026 Movatter.jp