以下示例
id desc
0 qqqqqwertyyyy
1 qwerty
2 bbbbqwerty
3 a qwerty
0 qqqqqwertyyyy
1 111qwerty
答案 0 :(得分:1)
答案 1 :(得分:1)
匹配前缀& postfix,试试这个:
SELECT * FROM tablename WHERE
REGEXP_LIKE (fieldname, '[^[:space:]]+qwerty')
OR REGEXP_LIKE (fieldname, 'qwerty[^[:space:]]+');