Skip to main content
Version: V1.4.0

Array constructor functions

Array constructor functions create array values. seekdb supports the array() function and the [] operator.

array​

The array() function is used to construct an array data type. The syntax is as follows:

array(elem1, elem2, elem3, ..., elemN)
[elem1, elem2, elem3, ..., elemN]

elem1~elmenN: The input parameters must be of the same data type. For information about the array data types supported by seekdb, see Overview of array data types.

Here is an example:

SELECT array(1, 2, 3);
+----------------+
| array(1, 2, 3) |
+----------------+
| [1,2,3] |
+----------------+
1 row in set (0.001 sec)

[]

The [] operator can also be used to construct array data types. Here is an example:

SELECT [1, 2, 3];
+-----------+
| [1, 2, 3] |
+-----------+
| [1,2,3] |
+-----------+
1 row in set (0.001 sec)