Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Like Operator for checking multiple words

I'm struggling for a like operator which works for below example

Words could be

MS004 -- GTER   
MS006 -- ATLT   
MS009 -- STRR   
MS014 -- GTEE   
MS015 -- ATLT

What would be the like operator in Sql Server for pulling data which will contain words like ms004 and ATLT or any other combination like above.

I tried using multiple like for example

where column like '%ms004 | atl%' 

but it didn't work.

EDIT

Result should be combination of both words only.

like image 901
Mayank Pathak Avatar asked Jan 21 '26 09:01

Mayank Pathak


1 Answers

Seems you are looking for this.

`where column like '%ms004%' or column like '%atl%'`

or this

`where column like '%ms004%atl%'
like image 151
peter.petrov Avatar answered Jan 23 '26 21:01

peter.petrov