I am using MySQL.
I have a car table in my database, and there is a name
column in that table.
Suppose the name
column of the table contain values:
+----------+
| name |
+----------+
| AAA BB |
----------
| CC D BB |
----------
| OO kk BB |
----------
| PP B CC |
----------
I would like to search the table where name
column value contains word "BB" (not substring), What is the SQL command to achieve this ?
I know LIKE , but it is used to match a contained substring, not for a word match.
P.S.
My table contains large data. So, I probably need a more efficient way than using LIKE
The values in name
column are random strings.
Please do not ask me to use IN (...) , because the values in that column is unpredictable.