Wildcard characters in a like statement in MySQL: percent, underline, and escape
% represents any number of characters
SQL code http://blog.csdn.net/yc7369/
SELECT * from user where username like '%huxiao ';
SELECT * from user where username like ' huxiao% ';
SELECT * from user where username like '%huxiao% ';
_ Represents a character
SQL code
SELECT * from user where username like ' _ ';
SELECT * from user where username like ' Huxia_ ';
SELECT * from user where username like ' H_xiao ';
If I really want to check% or _, how to do? Using escape, the% or _ after the escape character is not used as a wildcard, noting that the% and _ of the previous escape characters are still in the wildcard role
SQL code
Select username from Gg_user where username like '%xiao/_% ' escape '/';
Select username from Gg_user where username like '%xiao/%% ' escape '/';
This column more highlights: http://www.bianceng.cn/database/MySQL/