Wildcard Characters - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-30
dita:mapPath
tpt1555966086716.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantage™

The % and _ characters may be used in any combination in pattern_expression.

Character Description
% (PERCENT SIGN) Represents any string of zero or more arbitrary characters.

Any string of characters is acceptable as a replacement for the percent.

_ (LOW LINE) Represents exactly one arbitrary character.

Any single character is acceptable in the position in which the underscore character appears.

The underscore and percent characters cannot be used in a pattern. To get around this, specify a single escape character in addition to pattern_expression. For details, see ESCAPE Feature of LIKE.

The following table describes how the metacharacters % and _ (and their fullwidth equivalents) behave when matching strings for various server character sets. Note that ANSI only defines the single byte spacing underscore and percent sign metacharacters.

Teradata SQL extends the permissible metacharacter set for the LIKE predicate to include the fullwidth underscore and the fullwidth percent sign.

FOR this server character set … USE this metacharacter … TO match this character or characters …
ANSI Mode Teradata Mode
KANJI1 spacing underscore any one single- or multibyte character. any one single byte character.
fullwidth spacing underscore any one single byte character or multibyte character. any one single byte character or multibyte character.
percent sign any sequence of single or multibyte characters. any sequence of single byte characters or multibyte characters.
fullwidth percent sign any sequence of single or multibyte characters. any sequence of single byte characters or multibyte characters.
UNICODE

LATIN

KANJISJIS

fullwidth spacing underscore none.

These characters are not treated as metacharacters in order to maintain compliance with the ANSI SQL standard.

fullwidth percent
GRAPHIC fullwidth spacing underscore any one single GRAPHIC character.
fullwidth percent sign any sequence of GRAPHIC characters.