メインコンテンツまでスキップ
バージョン: 2.1

ARRAY

デスクリプション

可変個の要素を持つ配列を構築して返します。Tは列またはリテラルを指定できます。

Syntax

ARRAY([ <element> [, ...] ])

パラメータ

パラメータ説明
<element>このパラメータは複数の列または定数を指定できます

戻り値

配列を返します。

select array("1", 2, 1.1);
+------------------------------------------------+
| array('1', cast(2 as TEXT), cast(1.1 as TEXT)) |
+------------------------------------------------+
| ["1", "2", "1.1"] |
+------------------------------------------------+
select array(null, 1);
+----------------+
| array(NULL, 1) |
+----------------+
| [NULL, 1] |
+----------------+
select array(1, 2, 3);
+----------------+
| array(1, 2, 3) |
+----------------+
| [1, 2, 3] |
+----------------+
select array(qid, creationDate, null) from nested  limit 4;
+-------------------------------------------------------+
| array(cast(qid as DATETIMEV2(0)), creationDate, NULL) |
+-------------------------------------------------------+
| [null, "2009-06-16 07:40:56", null] |
| [null, "2009-06-16 07:50:05", null] |
| [null, "2009-06-16 08:09:18", null] |
| [null, "2009-06-16 08:15:45", null] |
+-------------------------------------------------------+