ProAnswers.org

When do you use a LIKE statement?

When do you use a LIKE statement?

1 Like

To do partial search e.g. to search employee by name, you need not specify the complete name; using LIKE, you can search for partial string matches.

Example SQL : SELECT EMPNO FROM EMP WHERE EMPNAME LIKE 'SAM%' 

% is used to represent remaining all characters in the name.

This query fetches all records contains SAM in three characters.