JSON_ARRAY_EXTRACT()
function returns the JSON array as a set of JSON values.
JSON_ARRAY_EXTRACT()
has the basic syntax as seen below.
JSON_ARRAY_EXTRACT()
requires the following parameters:
json_array
: the array to be extracted.::JSON
: argument indicating that the query is of type JSON.id
: ID of the element that we want to extract. It is read in an array format that starts with 0.JSON_ARRAY_EXTRACT
can also be achieved with the ->
operator, as shown in the syntax below:
from_json
: the JSON value from which to extract.::JSON
: a symbol that casts the string literal to a JSON type.path
: key of the field that we want to extract.->>
operator.