16.20 - Example: LIKE Predicate - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2020-03-25
dita:mapPath
xzf1512079057909.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
kby1472250656485

The following example uses the LIKE predicate to select a list of employees whose job title contains the string “Pres”:

   SELECT Name, DeptNo, JobTitle 
   FROM Employee 
   WHERE JobTitle LIKE '%Pres%' ;

The form %string% requires Teradata Database to examine much of each string x. If x is long and there are many rows in the table, the search for qualifying rows may take a long time.

The result returned is:

Name DeptNo JobTitle
Watson L 500 Vice President
Phan A 300 Vice President
Russel S 300 President