标签:where 没有 类型 字符 使用 通配符 红色 sel nbsp
like语句的通配符:百分号、下划线和escape
e.g.
select * from user where username like ‘%san‘ ; 名字 结尾是 san 的记录
select * from user where username like ‘zhang%‘ ; 名字开头是 zhang 的记录
select * from user where username like ‘%san%‘ ; 名字含 san 的记录
select * from user where username like ‘%san%‘ and username like ‘%zhang%‘; 名字中既有san又有 zhang的记录
select * from user where username like ‘_‘; 名字只有一个字符的记录
select * from user where username like ‘huxia_‘; 名字以huxia 开头,结尾有一个字符的记录
select * from user where username like ‘h_xiao‘;
e.g.
select username from gg_user where username like ‘%xiao/_%‘ escape ‘/‘; 注意,此处红色的_只能表示_,而没有通配符的功能
select username from gg_user where username like ‘%xiao/%%‘ escape ‘/‘; 此处红色的%只能表示%,而没有通配符的功能
标签:where 没有 类型 字符 使用 通配符 红色 sel nbsp
原文地址:http://www.cnblogs.com/zhu-tingting/p/7536907.html