Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想匹配 2 个确切的词,例如
select col from mytable where col like '%one%two%'
但使用
select col from mytable where col RLIKE '[[:<:]]one[[:>:]][[:<:]]two[[:>:]]'
它没用。任何帮助表示赞赏。
您的正则表达式不正确。您需要.*介于one和之间,two因为这是两个不同的词。.*将匹配这 2 个单词之间的 0 个或更多长度的文本。
.*
one
two
使用此查询:
select col from mytable where col RLIKE '[[:<:]]one[[:>:]].*[[:<:]]two[[:>:]]'