Let's say I have a table with two columns:
ID, FullName
And I have the following entries:
John Bob Smith John Bobby Smith
My problem:
I want to return only a string containing the corresponding word "Bob", and I do not want to return strings containing similar words like "Bobby"
When I do a search using:
Select * From Table1 Where FullName like '%bob%'
I get two lines that are wrong.
Select * From Table1 Where FullName = 'Bob'
this does not return any rows.
Select * From Table1 Where FullName like 'Bob'
it also does not return any rows.
I tried using different wildcards, but nothing works, I also tried CHARINDEX
and PATINDEX
, but they also do not return the desired results.
Any suggestions?
Thanks.
source share