Available in versions: Dev (3.20)

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.

LIKE predicate (binary)

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

Binary LIKE predicates are the binary version of the LIKE predicate.

With jOOQ, the binary LIKE predicate can be created from any column expression as such:

TITLE     LIKE CAST('%abc%' AS VARBINARY)
TITLE NOT LIKE '%abc%'
BOOK.TITLE.binaryLike("%abc%".getBytes())
BOOK.TITLE.notBinaryLike("%abc%".getBytes())
See LIKE predicate for a text version of this predicate.

Dialect support

This example using jOOQ:

BOOK.TITLE.binaryLike("%abc%".getBytes())

Translates to the following dialect specific expressions:

Aurora Postgres, Postgres, YugabyteDB

CAST(BOOK.TITLE AS bytea) LIKE CAST(E'\\045\\141\\142\\143\\045' AS bytea)

ASE, Access, Aurora MySQL, BigQuery, ClickHouse, CockroachDB, DB2, Derby, DuckDB, Exasol, Firebird, H2, HSQLDB, Hana, Informix, MariaDB, MemSQL, MySQL, Oracle, Redshift, SQLDataWarehouse, SQLServer, SQLite, Snowflake, Sybase, Teradata, Trino, Vertica

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

References to this page

Feedback

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

The jOOQ Logo