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 do I use PostgreSQL's XMIN and XMAX features?
- How do I set the PostgreSQL work_mem parameter?
- How do I use PostgreSQL with Qt?
- How do I use PostgreSQL's ON CONFLICT DO NOTHING clause?
- How can I troubleshoot zero damaged pages in PostgreSQL?
- How do I export data from PostgreSQL to an XML file?
- How can I use PostgreSQL for my project?
- How can I use PostgreSQL substring functions?
- How do I create a PostgreSQL trigger?
See more codes...