blog

Home / DeveloperSection / Blogs / Wildcards Operators in SQL

Wildcards Operators in SQL

Chris Anderson3929 30-Nov-2011

SQL wildcards can substitute for one or more characters when searching for data in a database. SQL wildcards must be used with the SQL LIKE operator which is used to compare a value to similar values using wildcard operators.

Two wildcard Operators in SQL are as under:

1)      The percent sign (%): It matches one or more characters. Note that MS Access uses the asterisk (*) wildcard character instead of the percent sign (%) wildcard character.

Example:
  SELECT * FROM table_name
  WHERE column LIKE 'ABC%'

2)      The underscore (_): It matches one character. Note that MS Access uses a question mark (?) instead of the underscore (_) to match any one character.

Example:
               SELECT * FROM table_name                WHERE column LIKE '_ABC'

The percent sign represents zero, one, or multiple characters and the underscore represents a single number or character. The symbols can be used in combinations.


Updated 18-Sep-2014
hi I am software developer at mindstick software pvt. ltd.

Leave Comment

Comments

Liked By