MySQL select maximum length of matching string

后端 未结 3 1418
星月不相逢
星月不相逢 2021-01-07 06:38

I need to return all the text results(s), if any, that share the maximum length left bounded substring common to the search string.

Given a search for \"StackOverflo

3条回答
  •  长情又很酷
    2021-01-07 07:16

    Don't know why you would look at the smallest first. I would do that in reverse... try by the LONGEST EXACT match first, and if not found, work backwards 1 character at a time until one is found.

提交回复
热议问题