Wildcard Characters


☞ It is used to perform pattern matching.

Percent (%) : It matches any string.

Underscore ( _ ) : It matches any one character.

☞ It is used along with LIKE.

Syntax :

SELECT * FROM <table_name>
WHERE <column_name> LIKE 'string_pattern';

Example :

SELECT * FROM Student
WHERE name LIKE '%A';

OR

SELECT * FROM Student
WHERE name LIKE 'A%';

OR

SELECT * FROM Student
WHERE name LIKE '%A%';

OR

SELECT * FROM Student
WHERE name LIKE '_n%';

OR

SELECT * FROM Student
WHERE name LIKE '_ma_';

OR

SELECT * FROM Student
WHERE name LIKE '_%y_';