Hello. I will clarify the question a little: it is required to find such strings in the table, the value of some field in which is a substring of the given string.

Example table:

+----+---------+-----------+ | ID | WORD | SOMEVALUE | +----+---------+-----------+ | 1 | ABCD | 1002 | +----+---------+-----------+ | 2 | ABCDEFJ | 29412 | +----+---------+-----------+ | 3 | ABCDE | 417 | +----+---------+-----------+ 

It is required to select lines in which the value of the WORD field is a substring of “ABCDEF” (i.e., lines 1,3).

I encounter such a problem at first, so I can’t even imagine where to start. Thank you in advance.

  • four
    where 'ABCDEF' like concat('%',word,'%') well, or the first percent is not needed, if you need to strictly from the beginning - Mike
  • "A Casket just opened" ... Many thanks, it helped) - Artem Nosov

1 answer 1

Answer to the question:

Mike : where 'ABCDEF' like concat ('%', word, '%')