Reputation: 85
I have table invalidtext
. In this table I have records like
+----+---------+
| id | text |
+----+---------+
| 1 | Yahoo |
| 2 | Gmail |
| 3 | Windows |
+----+---------+
Now I have a string like
hello yahoo how are you?
I want to check if "hello yahoo how are you?" contains any word which is in invalidtext
table.
We can see yahoo
word is in this table, so record should have to be find.
Which query will work to search ?
Upvotes: 0
Views: 237
Reputation: 204756
select text
from invalidtext
where '$input' like concat('%', text, '%')
Upvotes: 1