SQL - SPLessons

SQL Wildcard Operators

Chapter 22

SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

SQL Wildcard Operators

SQL Wildcard Operators

shape Description

SQL Wildcard Operators are similar to Like Condition clause operations. And these LIKE clause permits some special cases to be utilized as a part of Where Clause clause such as Insert, Delete, Select and Update proclamation. SQL Like clause also permits execution of design coordination.

shape Examples

By viewing the below example, the concept of SQL Wildcard Operators can be easily understood.

sql> select * from employee;
+--------+-------+-------+--------+-----------+
| emp_id | ename | sal   | deptno | job       |
+--------+-------+-------+--------+-----------+
|   1001 | mike  | 12000 |     10 | manager   |
|   1002 | rambo | 13000 |     20 | scalesman |
|   1003 | kate  | 14000 |     10 | manager   |
|   1003 | jeo   | 14000 |     20 | manager   |
|   1003 | finn  | 14000 |     30 | manager   |
+--------+-------+-------+--------+-----------+
5 rows in set (0.00 sec)

sql> select * from employee where ename like '%bo';
+--------+-------+-------+--------+-----------+
| emp_id | ename | sal   | deptno | job       |
+--------+-------+-------+--------+-----------+
|   1002 | rambo | 13000 |     20 | scalesman |
+--------+-------+-------+--------+-----------+
1 row in set (0.10 sec)

sql> select * from employee where ename like 'k%';
+--------+-------+-------+--------+-----------+
| emp_id | ename | sal   | deptno | job       |
+--------+-------+-------+--------+-----------+
|   1003 | kate  | 14000 |   10   | manager   |
+--------+-------+-------+--------+-----------+
1 row in set (0.10 sec)

Here in the above example, the Like clause will permit to match any string of length characters.

Summary

shape Key Points

  • SQL Wildcard Operators – Wildcard operations are similar to Like operators.