Amit
Amit

Reputation: 142

Find a word from a string in SQL Server

I have some values into a table like below :-

  1. Bank Of America
  2. testBank Of America
  3. State Bank Of India
  4. ICICI Bank
  5. Test @Bank*

I want a query to get all the values which contains Bank only. Proper word should match.

Result should be like :-

Upvotes: 0

Views: 544

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269603

One method is to add spaces to the beginning and end of the column and then look for ' Bank ':

where ' ' + col + ' ' like '% Bank %'

Upvotes: 2

Related Questions