JSON_EXTRACT()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Enterprise Server
Topics on this page:
Overview
A description for this Function has not yet been added to this Documentation.
EXAMPLES
SELECT JSON_EXTRACT('[1, 2, [3, 4]]', '$[2]');
+----------------------------------------+
| JSON_EXTRACT('[1, 2, [3, 4]]', '$[2]') |
+----------------------------------------+
| [3, 4] |
+----------------------------------------+
CREATE TABLE t (j JSON);
INSERT INTO t VALUES
('{"id": 1, "name": "John"}'),
('{"id": 2, "name": "Jon"}');
SELECT j, JSON_EXTRACT(j, "$.id"), JSON_EXTRACT(j, "$.name") FROM t;
+---------------------------+-------------------------+---------------------------+
| j | JSON_EXTRACT(j, "$.id") | JSON_EXTRACT(j, "$.name") |
+---------------------------+-------------------------+---------------------------+
| {"id": 1, "name": "John"} | 1 | "John" |
| {"id": 2, "name": "Jon"} | 2 | "Jon" |
+---------------------------+-------------------------+---------------------------+
CHANGE HISTORY
EXTERNAL REFERENCES
Additional information on this topic may be found in the MariaDB Public Knowledge Base.