postgresqlHow do I use the PostgreSQL ILIKE operator?
The PostgreSQL ILIKE operator is used to perform case-insensitive pattern matching. It is similar to the LIKE operator, but performs a case-insensitive search.
Example code
SELECT *
FROM table_name
WHERE column_name ILIKE '%string%';
Output example
column_name
------------
String
string
STRING
Code explanation
- SELECT *: selects all columns from the table.
- FROM table_name: specifies the table from which the columns are selected.
- WHERE column_name ILIKE '%string%': searches for the string in the specified column, regardless of case. The '%' is a wildcard character that matches any characters before or after the string.
Helpful links
More of Postgresql
- How do I use PostgreSQL's XMLTABLE to parse XML data?
- How can I retrieve data from PostgreSQL for yesterday's date?
- How do I use PostgreSQL's XMIN and XMAX features?
- How do I use the PostgreSQL quote_ident function?
- How do I round a number in PostgreSQL?
- How do I use the PostgreSQL NVL function?
- How do I use PostgreSQL with Qt?
- How can I use PostgreSQL XOR to compare two values?
- How do I use the WITH statement in PostgreSQL?
- How can I decide between PostgreSQL and MySQL for my software development project?
See more codes...