Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16 | 3.15 | 3.14

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

JSON_EXISTS predicate

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The JSON_EXISTS predicate can be used to check whether a JSON path expression produces a value within a JSON document (see also the JSON_VALUE function)

FROM dual
WHERE json_exists('{"a":1}', '$.a')
      .where(jsonExists(val(json("{\"a\":1}")), "$.a"))

Dialect support

This example using jOOQ:

jsonExists(val(json("{\"a\":1}")), "$.a")

Translates to the following dialect specific expressions:

Aurora Postgres, CockroachDB

JSON_EXISTS(CAST('{"a":1}' AS json), '$.a')

ClickHouse, DB2, MariaDB, Oracle

JSON_EXISTS('{"a":1}', '$.a')


json_contains_path('{"a":1}', 'one', '$.a')


jsonb_path_exists(CAST('{"a":1}' AS jsonb), CAST('$.a' AS jsonpath))


json_type('{"a":1}', '$.a') IS NOT NULL

ASE, Access, Aurora MySQL, BigQuery, Derby, DuckDB, Exasol, Firebird, H2, HSQLDB, Hana, Informix, MemSQL, Redshift, SQLDataWarehouse, SQLServer, Snowflake, Sybase, Teradata, Trino, Vertica, YugabyteDB

Generated with jOOQ 3.20. Translate your own SQL on our website

References to this page


Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo