mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-13 16:52:56 +00:00
34 lines
1.6 KiB
Plaintext
34 lines
1.6 KiB
Plaintext
--- json_path_exists ---
|
|
SELECT json_path_exists(parse_json('{"a": 1, "b": 2}'), '$.a');
|
|
|
|
+--------------------------------------------------------------------+
|
|
| json_path_exists(parse_json(Utf8("{"a": 1, "b": 2}")),Utf8("$.a")) |
|
|
+--------------------------------------------------------------------+
|
|
| true |
|
|
+--------------------------------------------------------------------+
|
|
|
|
SELECT json_path_exists(parse_json('{"a": 1, "b": 2}'), '$.c');
|
|
|
|
+--------------------------------------------------------------------+
|
|
| json_path_exists(parse_json(Utf8("{"a": 1, "b": 2}")),Utf8("$.c")) |
|
|
+--------------------------------------------------------------------+
|
|
| false |
|
|
+--------------------------------------------------------------------+
|
|
|
|
SELECT json_path_exists(parse_json('[1, 2]'), '[0]');
|
|
|
|
+----------------------------------------------------------+
|
|
| json_path_exists(parse_json(Utf8("[1, 2]")),Utf8("[0]")) |
|
|
+----------------------------------------------------------+
|
|
| true |
|
|
+----------------------------------------------------------+
|
|
|
|
SELECT json_path_exists(parse_json('[1, 2]'), '[2]');
|
|
|
|
+----------------------------------------------------------+
|
|
| json_path_exists(parse_json(Utf8("[1, 2]")),Utf8("[2]")) |
|
|
+----------------------------------------------------------+
|
|
| false |
|
|
+----------------------------------------------------------+
|
|
|