• Welcome to Web Hosting Community Forum for Webmasters - Web hosting Forum.
 

wildcard characters in LIKE clauses?

Started by kavitajain9782, April 27, 2019, 01:19:26 PM

WordPress Premium Themes


kavitajain9782

Hello Dear,                   

               Please Tell Me What ways can we use wildcard characters in LIKE clauses?

ServersBase

%, _, [ ],-,^ these all are wild cards. All the wildcards can also be used in combinations.
for example:
WHERE CustomerName LIKE 'a%'   Finds any values that starts with "a"
WHERE CustomerName LIKE '%a'   Finds any values that ends with "a"
WHERE CustomerName LIKE '%or%'   Finds any values that have "or" in any position
WHERE CustomerName LIKE '_r%'   Finds any values that have "r" in the second position
WHERE CustomerName LIKE 'a_%_%'   Finds any values that starts with "a" and are at least 3 characters in length
WHERE CustomerName LIKE 'a%o'            Finds any values that starts with "a" and ends with "o"
Anika Bhardwaj -ServersBase.Com
100% Uptime Guarantee

WordPress Premium Themes