[NOT] LIKE

Purpose

This is similar to predicate [NOT]REGEXP_LIKE, but with only simple pattern matching.

Syntax

NOT LIKE PREDICATE

Usage notes

The following special characters can be used in this predicate:

Special character Description
_

Wildcard for exactly one character

%

Wildcard for any number of characters, including no character

esc_chr

Escape character to allow the characters _ and % to be used literally in a pattern. The default is the session variable DEFAULT_LIKE_ESCAPE_CHARACTER. For more information, see ALTER SESSION.

Example:
SELECT 'abcd' LIKE 'a_d' AS res1, '%bcd' like '\%%d' AS res2;