The LIKE keyWord uses a regular expression to contain the pattern that the values are matched against. The pattern contains the character string to search for, which can contain any combination of four wildcards.
Wildcard Meaning % Any string of zero or more characters. _ Any single character. [ ] Any single character within the specified range (for example, [a-f]) or set (for example, [abcdef]). [^] Any single character not within the specifIEd range (for example, [^a - f]) or set (for example, [^abcdef]).Enclose the wildcard(s) and the character string in single quotation marks, for example:
This query finds all phone numbers in the authors table that have area code 415:
SELECT phone
FROM pubs.dbo.authors
WHERE phone LIKE '415%'