Search for text between delimiters in MySQL

前端 未结 11 2409
情歌与酒
情歌与酒 2021-02-08 03:39

I am trying to extract a certain part of a column that is between delimiters.

e.g. find foo in the following

test \'esf :foo: bar

So in the above I\'d wa

11条回答
  •  深忆病人
    2021-02-08 04:13

    A combination of LOCATE and MID would probably do the trick.

    If the value "test 'esf :foo: bar" was in the field fooField:

    MID( fooField, LOCATE('foo', fooField), 3);
    

提交回复
热议问题