json_array_get(json_array, index)



Query 1

presto:default> SELECT json_array_get('[11, 12, 13]', 0) as JSON; 

Result

 JSON 
------ 
  11

Query 2

presto:default> SELECT json_array_get('[11, 12, 13]', -1) as JSON; 

Result

 JSON 
------ 
  13 

Query 3

presto:default> SELECT json_array_get('[11, 12, 13]', 5) as JSON; 

Result

 JSON 
------ 
 NULL 
apache_presto_sql_functions.htm
Advertisements