MySQL的REGEXP 和 like 在匹配上的区别
其中like要求整个数据都要匹配,而REGEXP只需要部分匹配即可。
也就是说,用Like,必须这个字段的所有内容满足条件,而REGEXP只需要有任何一个片段满足即可。
A REGEXP pattern match succeeds if the pattern matches anywhere in
the value being tested. (This differs from a LIKE pattern match, which
succeeds only if the pattern matches the entire value.)
本文探讨了MySQL中REGEXP与Like两种模式匹配操作符的不同之处。REGEXP允许部分匹配,而Like则需要整个字段完全匹配。理解这些差异有助于更高效地进行数据检索。
10万+

被折叠的 条评论
为什么被折叠?



