Wildcard Character | Key | Description |
---|---|---|
% | Percent |
This wildcard character can replace zero or more characters.
Ex: WHERE Title LIKE 'Manager%' |
_ | Underscore |
This wildcard character can replace one character.
Ex: WHERE FirstName LIKE '_ohn' |
[ ] | Square brackets |
This wildcard character can replace one character within a given set or range.
Ex1: Using range: WHERE FirstName LIKE '[g-m]ohn' (In this case, first character can be "g" or "h" or "i" or "j" or "k " or "l" or "m"). Ex2: Using set: WHERE FirstName LIKE '[hijk]ohn' (In this case, first character can be "h" or "i" or "j" of "k"). Ex3: Using set: WHERE FirstName LIKE '[h,i,j,k]ohn' (Same as above, only difference is that the characters within the set is seperated by comma, which makes it more readable). |
^ | Caret |
This wildcard character can replace one character which is not in the given set or range.
Ex1: Using range: WHERE FirstName LIKE '^[a-d]ohn' (In this case, first character can be any character except "a","b","c" or "d"). Ex2: Using set: WHERE FirstName LIKE '^[abcd]ohn' (Same result as previous example). Ex3: Using set: WHERE FirstName LIKE '^[a,b,c,d]ohn' (Same result as previous example). |