This comparison is a pattern-matching comparison. The comparison is true if the column name matches the pattern.
col1 [NOT] LIKE pattern
The pattern is a character constant of 255 characters or less that contains any combination of characters within which the percent sign (%) and the underscore character (_) have special significance:
% represents a series of zero or more arbitrary characters. Entering %% is the same as entering %.
_ represents exactly one arbitrary character.
Any character other than % or _ represents a single occurrence of that character.
Trailing blanks in the column or in the pattern will be ignored for comparison purposes.
The following table lists example patterns, column names that match the pattern, and column names that do not match the pattern:
Does Not Match
TAB, ATAB, TABLE, TABULAR, MY_TABLE
ATAB, MY_TABLE, MY_TAABLE
TAB , ATAB, TABULAR, MY_TABLE, MY_TAABLE
Use an ESCAPE clause to define the escape character to be used to escape the “%” and “_“ characters in the LIKE statement so that they can be matched explicitly.
You can use ESCAPE '\' in order that a string with 'A%\_' would allow all values starting with 'A' and ending with '_' to be returned.
For example, the pattern %\_TAB% matches the column name MY_TABLE but does not match the column name MYTABLE.