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 set a PostgreSQL interval to zero?
- How can I troubleshoot zero damaged pages in PostgreSQL?
- How can I use PostgreSQL and ZFS snapshots together?
- How can Zalando use PostgreSQL to improve its software development?
- How can I use PostgreSQL's "zero if null" feature?
- How do I use PostgreSQL and ZFS together?
- How do I use PostgreSQL ZonedDateTime to store date and time information?
- How can I use PostgreSQL with YAML?
- How do I use PostgreSQL's XMLTABLE to parse XML data?
- How do I store binary data in a Postgresql database using the bytea data type?
See more codes...