Like operator with IN Clause SQL

If you are here you already know about In Clause and Like in SQL, let me just give you a brief over view about it

 

Like is a wild card when used would search up any row which has your condition

(For better understanding Please look it up)

 

IN Clause when used with where statement will return all the records that meet criteria in the list provided in the IN clause

 

Like how ever can’t be used with IN Clause, for that you will have to do something like this :

 

 

Select * from Table

where column like ‘%ab%’ or column like %cd%’ or column like %ef%’

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s