# Databases > SQL Using LIKE operator in multiple condition

## Sant_parkash

If we have multiple conditions to check, can we use like operator?
eg where empid like ('123%') or like ('23%')?

----------


## susarlasireesha

The LIKE operator is used in character string comparisons with 
pattern matching.

If empid is defined as varchar  Then
select * from emp where empid like '123%'
retrieve records of emp where empid starts with 123
select * from emp where empid like '23%'
retrieve records of emp where empid starts with 23

----------


## sridharrganesan

Like operator is used to retrieve records starting with the alphabet or numeric specified as the condition. For example,

*Select * from emp where emp_name like 'Joh%'*

This statement will retrieve the records where the employee name starts with "Joh"

----------


## debasisdas

LIKE operator is used for pattern matching you can combine multiple statments for different conditions using logical operators.

----------


## mehta_hetal

u can combine like operator in multiple condition 

for eg. where (name like 'abc%' or name like 'pqr%');

----------


## lalit84

I have a table like employee containing name column.

In name it contains:- SMITH,MARTIN,MILLER,ADAMS etc.

I want a result from name whose first character is 'M', Second character can be any, But third character should not be 'R'.

select name from employee where name like 'M_[^R]%' is fetching 0 results.

Please suggest a query for oracle server.

----------


## debasisdas

You need to use REGEXP_LIKE for the purpose.

----------

