Product Solutions Support
Try MemSQL

JSON_EXTRACT_<type>

This is a set of three JSON functions, which returns the value of a given key in a JSON map. Maps are in the form:

{"a": 1, "b": 2, "c": 3}

Return Type

Examples

mysql> select json_extract_double('{"a":1, "b":2, "c": [3,4,5]}', 'b') as get_b;
+-------+
| get_b |
+-------+
|     2 |
+-------+

mysql> select json_extract_json('{"a":1, "b":2, "c": [3,4,5]}', 'c') as get_c;
+---------+
| get_c   |
+---------+
| [3,4,5] |
+---------+

mysql> select json_extract_json('{"a":1, "b":2, "c": [3,4,5]}', 'z') as get_z;
+-------+
| get_z |
+-------+
| NULL  |
+-------+
Was this article useful?