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

Recommended Providers

Fully Managed WordPress Hosting
lc_banner_leadgen_3
Fully Managed WordPress Hosting

WordPress Theme

Divi WordPress Theme
WPZOOM

Forum Membership

Forum Membership

wildcard characters in LIKE clauses?

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

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