Pattern Matching in SQL – Using Wildcards
In the previous post we have studied about the ‘WHERE’ clause (used to filter out the output ) and the ‘EQUALITY’ operator ( used along with the WHERE clause to specify the filter condition). In this post we will study about another operator, used along with WHERE clause called ‘LIKE’ which is used for ‘Pattern Matching’.
What is meant by pattern matching and How it differs from Equality
What are Wildcards?
- Wildcards are Special Characters that are used to perform ‘Pattern – Matching’.
- They are basically used to search similar data in the table.
- They increase the scope of searching in the string.
- Wildcard uses some characters called ‘Wildcard Characters’. These characters act as substitute for other characters in the string.
- ‘LIKE’ is an operator which is used in combination with wildcard characters .The pattern to be matched is written after LIKE operator.
- The LIKE operator can be used in combination with SELECT, INSERT,UPDATE and DELETE.
Types of Wildcard Characters :