Wildcard characters represent one or more characters, or a range of characters, in a match_string. A match_stringis a character string containing the pattern to find in the expression. It can be any combination of constants, variables, and column names or a concatenated expression, such as:
like @variable + "%".
If the match string is a constant, it must always be enclosed in single or double quotes.
Use wildcard characters with the keyword like to find character and date strings that match a particular pattern. You cannot use like to search for seconds or milliseconds. For more information, see “Using wildcard characters with datetime data”.
Use wildcard characters in where and having clauses to find character or date/time information that is like—or not like—the match string:
{where | having} [not] expression [not] like match_string [escape "escape_character "]
expression can be any combination of column names, constants, or functions with a character value.
Wildcard characters used without like have no special meaning. For example, this query finds any phone numbers that start with the four characters “415%”:
select phone from authors where phone = "415%"
Copyright © 2005. Sybase Inc. All rights reserved. |