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

Teradata Vantage™ - SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/djk1612415574830.ditamap
dita:ditavalPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/wrg1590696035526.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 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