Built-in Functions → like
like() is a boolean function that returns true if a string pattern can be found in a given string.
Note
The like() function evaluates field and searches for an instance of pattern. It returns true if it finds a pattern in the field and stops searching. If a pattern is not found in the field, like
returns false.
Signature
like(string expr field, string pattern, [string esc])
- field :
string
expression to search - pattern :
string
to search for - esc :
string
Returns
boolean
Example
Find the number of times the country name contained in U shows up in a given table.
count(like(Sales_Acme.Countries.COUNTRY_NAME, 'U%'))