This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||
|
4D v19
like_predicate
|
arithmetic_expression [NOT] LIKE arithmetic_expression [ESCAPE sql_string] |
||
A like_predicate is used to retrieve data matching the arithmetic_expression passed after the LIKE keyword. You can also pass the NOT keyword to search for data differing from this expression. The ESCAPE keyword can be used to prevent the character passed in sql_string from being interpreted as a wildcard. It is usually used when you want to search for the '%' or '_' characters.
This example selects the suppliers whose name contains "bob":
SELECT * FROM suppliers
WHERE supplier_name LIKE '%bob%';
Selects suppliers whose name does not begin with the letter T:
SELECT * FROM suppliers
WHERE supplier_name NOT LIKE 'T%';
Selects suppliers whose name begins with "Sm" and ends with "th":
SELECT * FROM suppliers
WHERE supplier_name LIKE 'Sm_th'
Product: 4D
Theme: Syntax rules
4D SQL Reference ( 4D v19)