Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
tablename - names values - %dfdf hhhh %fgfg
现在如果我想得到所有的名字starting from %,怎么办?
starting from %
您可以使用LIKE来测试一个值是否以某个子字符串开头。由于%是特殊字符,因此必须对其进行转义。
LIKE
%
要测试通配符的文字实例,请在其前面加上转义字符。如果不指定 ESCAPE 字符,则假定为“\”。
试试这个:
SELECT `values` FROM names WHERE `values` LIKE '\%%'
在线查看它:sqlfiddle