A RetroSearch Logo

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

Search Query:

Showing content from https://docs.databricks.com/aws/en/sql/language-manual/functions/like below:

like operator | Databricks Documentation

like operator

Applies to: Databricks SQL Databricks Runtime

Returns true if str matches pattern with escape.

Syntax​
str [ NOT ] like ( pattern [ ESCAPE escape ] )
str [ NOT ] like { ANY | SOME | ALL } ( [ pattern [, ...] ] )
Arguments​ Returns​

A BOOLEAN.

The pattern is a string which is matched literally, with exception to the following special symbols:

The default escape character is the '\'. If an escape character precedes a special symbol or another escape character, the following character is matched literally. It is invalid to escape any other character.

When using literals, use raw-literal (r prefix) to avoid escape character pre-processing.

str NOT like ... is equivalent to NOT(str like ...).

Examples​

SQL

> SELECT like('Spark', '_park');
true

> SELECT r'%SystemDrive%\Users\John' like r'%SystemDrive%\\Users%';
true

-- When not using raw literals, the escape character must be escaped.
> SELECT r'%SystemDrive%\Users\John' like '%SystemDrive%\\\\Users%';
true

> SELECT '%SystemDrive%/Users/John' like '/%SystemDrive/%//Users%' ESCAPE '/';
true

> SELECT like('Spock', '_park');
false

> SELECT 'Spark' like SOME ('_park', '_ock')
true

> SELECT 'Spark' like ALL ('_park', '_ock')
false
Related functions​

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