Wildcard Characters - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
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.