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 can I retrieve data from PostgreSQL for yesterday's date?
- How do I use PostgreSQL's XMIN and XMAX features?
- How can I use PostgreSQL's "zero if null" feature?
- How do I use PostgreSQL's XMLTABLE to parse XML data?
- How can I use PostgreSQL with YAML?
- How can I troubleshoot zero damaged pages in PostgreSQL?
- How do I use PostgreSQL ZonedDateTime to store date and time information?
- How can I monitor PostgreSQL performance using Zabbix?
- How can I use PostgreSQL with Zabbix?
- How can I integrate PostgreSQL with Yii2?
See more codes...