Skip to content

ILIKE

Grammar Description

The ILIKE operator is used similarly to the LIKE operator and is used to search for specified patterns in columns in the WHERE clause.

The main difference between the ILIKE operator and the LIKE operator is case sensitivity. When using ILIKE, characters in the string are considered the same regardless of whether they are upper or lowercase.

Grammar Structure

> SELECT column1, column2, ...
FROM table_name
WHERE columnN ILIKE pattern;

Example

drop table t1;
create table t1(a varchar(20));
insert into t1 values ​​('abc'), ('ABC'), ('abC');
select * from t1 where a ilike '%abC%';

mysql> select * from t1 where a ilike '%abC%';
+------+
| a |
+------+
| abc |
| ABC |
| abC |
+------+
3 rows in set (0.01 sec)