MySQL 中like语句的通配符:% 、 _ 、 escape ;且SQL模式是忽略大小写的
%:任意多个字符。
_:任意单个字符(可以代表一个中文字符)。
escape:将%,_转义,这样%和_就不为通配符了。
如:
select * from user where like '%xiao/_%' escape '/';
select * from user where like '%xiao/%%' escape '/';
MySQL 中like语句的通配符:% 、 _ 、 escape ;且SQL模式是忽略大小写的
%:任意多个字符。
_:任意单个字符(可以代表一个中文字符)。
escape:将%,_转义,这样%和_就不为通配符了。
如:
select * from user where like '%xiao/_%' escape '/';
select * from user where like '%xiao/%%' escape '/';