SQL LIKE operator

The LIKE operator is used in a WHERE clause to retrieve all records of a table whose specified column values match a specified pattern. The percent sign

Syntax:

SELECT * FROM tableName WHERE columnName LIKE pattern;

Example:

SELECT * FROM EMPLOYEE WHERE EMP_NAME LIKE 'P%';

Output:

EMP_ID	EMP_NAME	AGE	SALARY
1	Parbhjot	28	35000
5	Parmender	28	45000
4	Parbhjot	29	46000
2	Parmender	28	45000

  Next Topic: SQL ORDER BY Clause with example. Previous Topic: SQL UNION Operator with example.

 

Please follow and like us:
Content Protection by DMCA.com