JSON_OVERLAPS
Discover JSON_OVERLAPS in MariaDB. Available from version 10.9, this function compares two JSON documents, returning true if they share at least one common key-value pair, array element, or scalar val
Syntax
JSON_OVERLAPS(json_doc1, json_doc2)Description
Examples
SELECT JSON_OVERLAPS('false', 'false');
+---------------------------------+
| JSON_OVERLAPS('false', 'false') |
+---------------------------------+
| 1 |
+---------------------------------+
SELECT JSON_OVERLAPS('true', '["abc", 1, 2, true, false]');
+----------------------------------------------------+
| JSON_OVERLAPS('true','["abc", 1, 2, true, false]') |
+----------------------------------------------------+
| 1 |
+----------------------------------------------------+
SELECT JSON_OVERLAPS('{"A": 1, "B": {"C":2}}', '{"A": 2, "B": {"C":2}}') AS is_overlap;
+---------------------+
| is_overlap |
+---------------------+
| 1 |
+---------------------+Examples
Last updated
Was this helpful?

