How and Why use Wild Card Character in SQL?
Microsoft Net Framework

Wildcard characters are used with the SQL LIKE operator. The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. 

There are two wildcards used in conjunction with the LIKE operator:

  • % - The percent sign represents zero, one, or multiple characters

Queries&Examples

The following SQL statement selects all Users_tb with a  FirstName starting with "Ta%":

1.

SELECT * FROM Users_tb
WHERE FirstName LIKE 'Ta%';

The following SQL statement selects all Users_Tbl with a EmailAddress starting with "a", To “F”:

2.

Select* From users_tbl

Where EmailAddress Like ‘[A-F]%’

3.

SELECT * FROM Users_tbl
WHERE EmailAddress Not LIKE '[!bsp]%';

Share This with your friend by choosing any social account


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM