Available in versions: Dev (3.22) | Latest (3.21) | 3.20 | 3.19 | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12
CONTAINS IGNORE CASE predicate
Supported by ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
The CONTAINS IGNORE CASE predicate is a special case of the CONTAINS predicate, where the operand case is ignored.
Dialect support
This example using jOOQ:
BOOK.TITLE.containsIgnoreCase("abc")
Translates to the following dialect specific expressions:
ASE
lower(BOOK.TITLE) LIKE ('%' || str_replace(
str_replace(
str_replace(
lower('abc'),
'!',
'!!'
),
'%',
'!%'
),
'_',
'!_'
) || '%') ESCAPE '!'
Aurora MySQL, MariaDB, MySQL
lower(BOOK.TITLE) LIKE concat(
'%',
replace(
replace(
replace(
lower('abc'),
'!',
'!!'
),
'%',
'!%'
),
'_',
'!_'
),
'%'
) ESCAPE '!'
Aurora Postgres, CockroachDB, Firebird, H2, HSQLDB, Hana, Informix, Oracle, Postgres, SQLite, Sybase, Vertica
lower(BOOK.TITLE) LIKE ('%' || replace(
replace(
replace(
lower('abc'),
'!',
'!!'
),
'%',
'!%'
),
'_',
'!_'
) || '%') ESCAPE '!'
BigQuery, Spanner
strpos(lower(BOOK.TITLE), lower('abc')) > 0
Databricks, DuckDB
contains(
lower(BOOK.TITLE),
lower('abc')
)
DB2
lower(BOOK.TITLE) LIKE cast(('%' || replace(
replace(
replace(
lower('abc'),
'!',
'!!'
),
'%',
'!%'
),
'_',
'!_'
) || '%') AS VARCHAR(4000)) ESCAPE '!'
SQLDataWarehouse
charindex(lower('abc'), lower(BOOK.TITLE)) > 0
SQLServer
lower(BOOK.TITLE) LIKE ('%' + replace(
replace(
replace(
lower('abc'),
'!',
'!!'
),
'%',
'!%'
),
'_',
'!_'
) + '%') ESCAPE '!'
Access, ClickHouse, Exasol, MemSQL, Redshift, Snowflake, Teradata, Trino, YugabyteDB
/* UNSUPPORTED */
Generated with jOOQ 3.22. Support in older jOOQ versions may differ. Translate your own SQL on our website
Feedback
Do you have any feedback about this page? We'd love to hear it!