Example: LIKE Predicate - 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 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 Vantage 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