Example: LIKE Predicate

Teradata Vantage™ SQL Functions, Expressions, and Predicates

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1145-162K

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