Given a mainstring
, How can I check that a column, c
, in my database, contains substring of given string?
statement like ...c LIKE %mainstring%
won't do the work because it will check if mainstring
itself is a substring of c
. I want to check whether a substring of mainstring
is a substring of c
.
How can I achieve that in sql
?
EDIT:
Given mainstring
consists of words separated by ' '
I want to check if c
contains any of these words (complete word) - at least one of them.