A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/en/developer-guide/python-connector/../../sql-reference/functions/ilike below:

Website Navigation


[ NOT ] ILIKE | Snowflake Documentation

Categories:

String & binary functions (Matching/Comparison)

[ NOT ] ILIKE

Performs a case-insensitive comparison to determine whether a string matches or does not match a specified pattern. For case-sensitive matching, use LIKE instead.

LIKE, ILIKE, and RLIKE all perform similar operations. However, RLIKE uses POSIX ERE (Extended Regular Expression) syntax instead of the SQL pattern syntax used by LIKE and ILIKE.

Tip

You can use the search optimization service to improve the performance of queries that call this function. For details, see Search Optimization Service.

See also:

[ NOT ] LIKE , [ NOT ] RLIKE

Syntax
<subject> [ NOT ] ILIKE <pattern> [ ESCAPE <escape> ]

ILIKE( <subject> , <pattern> [ , <escape> ] )

Copy

Arguments

Required:

subject

Subject to match.

pattern

Pattern to match.

Optional:

escape

Character(s) inserted in front of a wildcard character to indicate that the wildcard should be interpreted as a regular character and not as a wildcard.

Returns

Returns a BOOLEAN or NULL.

Usage notes Collation details

Only the upper, lower, and trim collation specifications are supported. Combinations with upper, lower, and trim are also supported (for example, upper-trim and lower-trim), except for locale combinations (for example, en-upper).

Examples

Create a table that contains some strings:

CREATE OR REPLACE TABLE ilike_ex(name VARCHAR(20));
INSERT INTO ilike_ex VALUES
  ('John  Dddoe'),
  ('Joe   Doe'),
  ('John_down'),
  ('Joe down'),
  (null);

Copy

The following examples show the use of ILIKE, NOT ILIKE, and the wildcard character %:

SELECT * 
  FROM ilike_ex 
  WHERE name ILIKE '%j%h%do%'
  ORDER BY 1;

Copy

+-------------+                                                                 
| NAME        |
|-------------|
| John  Dddoe |
| John_down   |
+-------------+
SELECT *
  FROM ilike_ex
  WHERE name NOT ILIKE '%j%h%do%'
  ORDER BY 1;

Copy

+-----------+
| NAME      |
|-----------|
| Joe   Doe |
| Joe down  |
+-----------+
SELECT * 
  FROM ilike_ex 
  WHERE name ILIKE '%j%h%^_do%' ESCAPE '^'
  ORDER BY 1;

Copy

+-----------+                                                                   
| NAME      |
|-----------|
| John_down |
+-----------+

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4