As you know, if you use .. where col_name like "%word%"
, then it will be searching as wildcard. Ok, all is file. Now I want exactly the vice versa. I mean, I want to make the column wildcard based on the entry.
Please take a look at this:
// tb_name
+--------------+
| col_name |
+--------------+
| Ali |
| Martin |
| John |
+--------------+
I want to match the third row by this value: John Foo
. Or match the first row by this entry: Mr Ali
. So conceptically I want something like this: .. where %col_name% like "word"
. How can I do that in MySQL ?