mysql [ ]通配符在使用过程中会遇到无法模糊查询,查询结果结果为empty set。
首先:
[list]:匹配list代表的字符中的任一个,例如"[张李王]三",可以正确匹配的有“张三,李三,王三”,三个字符串。
用法:
使用[ ]通配符时,结合like使用是无法查询到想要的数据,要结合rlike,not rlike或者regexp,
not regexp使用。
在[^list]中时也是要结合 rlike,not rlike或者regexp,not regexp使用。
示例:

网友评论