AdBlock Detected!
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.
SQL ILIKE |
|
SQL > SQL Commands >
ILIKE
The ILIKE operator is very similar to the LIKE operator in that both are for pattern matching. There are two main differences between the two:
ILIKE works like LIKE for string pattern matching but ignores letter case, making it easy to match values regardless of whether they are uppercase or lowercase. It is available in PostgreSQL and Snowflake.
SyntaxThe syntax for the ILIKE operator is as follows:
{PATTERN} often consists of wildcards. We saw several examples of wildcard matching in a previous section. ExampleWe use the following table for our example. Table Store_Information
We want to find all stores whose name ends in 'O' or 'o.' To do so, we key in,
Result:
The "%" sign before 'o' means that there may be 0, 1, or more characters before the pattern we want to match. The use of ILIKE means that the last character of the store name could either be 'O' or 'o.' Out of the four store names, 'SAN DIEGO' and 'SAN FRANCISCO' both satisfy this pattern. Frequently Asked QuestionsQ: What is the difference between LIKE and ILIKE in SQL? Q: Which databases support the ILIKE operator? Q: How do I perform case-insensitive pattern matching in MySQL? Q: What wildcards can I use with ILIKE?
|
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.