SQL Wildcards
Ever since I started with SQL i've know about the '%' wildcard. Recently i've had this desire to improve my SQL skills and I found a few new wildcards which are outlined below. % Wildcard Using the following SELECT statement I can return all players who's firstname start's with an 'A' followed by zero or more characters.
1SELECT * FROM yourTBL WHERE firstname LIKE 'a%'
The results
Using the following SELECT statement I can return all players who's firstname have zero or more characters followed by 'AR' followed by zero or more characters.
1SELECT * FROM yourTBL WHERE firstname LIKE '%ar%'
The results
_ Wildcard Using '_' as a substitute for exactly one character I can return all players who's firstname start with a 'c' that is followed by any character and end with a 'sc'.
1SELECT * FROM yourTBL WHERE firstname LIKE 'c_sc'
The results
We can do this multiple times in a string.
1SELECT * FROM yourTBL WHERE firstname LIKE 'th_ma_'
The results
[charlist] Wildcard Using the following SELECT statement I can return all players who's firstname start's with an 'A' or 'C' or 'R' followed by zero or more characters.
1SELECT * FROM yourTBL WHERE firstname LIKE '[ACR]%'
The results
TweetBacks

There are no comments for this entry.
[Add Comment] [Subscribe to Comments]