JSON_EXTRACT_ARRAY returns an SQL ARRAY(TEXT) with the array’s elements as raw text, and otherwise returns NULL.
Syntax
Aliases
Parameters
Return Type
ARRAY(TEXT)
- If any input values are
NULL, the function will returnNULL.
Examples
For the JSON document used in the examples below, see JSON common example. Example The following code extracts the value at the path/value/dyid from the JSON document and returns NULL because the specified path does not reference an array:
Rows: 1Execution time: 5.28ms
/value/no_such_key in the JSON document and returns NULL because the key does not exist:
Rows: 1Execution time: 5.13ms
/value/keywords from the JSON document using the JSON pointer syntax:
Rows: 1Execution time: 5.21ms
/value/events from the JSON document using the JSON pointer syntax:
Rows: 1Execution time: 5.65ms