Let's say I have a table with two columns:
ID, FullName
And I have the following records in it:
John Bob Smith
John Bobby Smith
My problem is:
I want to return only the row that contains the matching word "Bob", and I don't want to return any rows that contain similar words like "Bobby"
When I search using :
Select *
From Table1
Where FullName like '%bob%'
I get the two rows which is wrong.
Select *
From Table1
Where FullName = 'Bob'
this return no rows at all.
Select *
From Table1
Where FullName like 'Bob'
this also does not return any rows.
I tried to use different wildcards but nothing works, I also tried the CHARINDEX
and the PATINDEX
but they do not return the needed results too.
Any suggestions?
Thanks.