4. Selecting ROWS to display: Step 16

Demo

LIKE operator

The LIKE operator allows comparison with a pattern of characters. A pattern contains special characters which match a single character(_), or zero or more characters(%).

Suppose we want to track down all employees with an 'A' as the second letter of their name (don't ask why you would want to do this!).

SQL

SELECT * FROM emp WHERE ename LIKE '_A%';

Output

empno ename job mgr hiredate sal comm deptno
7521 WARD SALESMAN 7698 1996-03-26 1250.00 500.00 30
7654 MARTIN SALESMAN 7698 1998-12-05 1250.00 1400.00 30
7900 JAMES CLERK 7698 2000-06-23 950.00 30

Progress

Proceed to Next step