json_str or json_path is invalid, or if no matching content can be found, this function will return NULL.
This function is supported from v3.3.
Syntax
Parameters
-
json_str: the JSON string. The supported data type is VARCHAR. -
json_path: the JSON path. The supported data type is VARCHAR.json_pathmust start with$and use.as the path separator. If the path includes., it can be enclosed in a pair of".[ ]is used as the array subscripts which starts from 0.
Examples
-
Get the value whose key is “k1”. The value is
trueand1is returned.Text -
Get the second element in the array whose key is “my.key”. The second element is
falseand0is returned.Text -
Get the first element in the array whose path is
k1.key -> k2. The first element isfalseand0is returned.Text