Apache Presto - 陣列運算子



以下是陣列運算子型別。

陣列下標 [] 運算子

查詢

presto:default> select array[1,2,3] as array_elements; 

結果

array_elements 
---------------- 
 [1, 2, 3] 

陣列下標運算子返回陣列元素。

陣列連線運算子

查詢

presto:default> select array[1,2,3] || array[4] as array_concat; 

結果

 array_concat 
-------------- 
 [1, 2, 3, 4]

此處,兩個陣列與一個數組連線。

apache_presto_basic_sql_operations.htm
廣告
© . All rights reserved.