aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/json/jsondocument/json_exists.sql
blob: 9246bbf26072e69ff11d41bdb04e0680ec8c70bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
/* syntax version 1 */
/* postgres can not */

$json = JsonDocument(@@{"a": {"b": 1}, "c": 2}@@);

SELECT
    JSON_EXISTS($json, "$.a"),
    JSON_EXISTS($json, "$.b"),
    JSON_EXISTS($json, "$.c"),
    JSON_EXISTS(CAST(NULL as JsonDocument), "$.a");