[英]mysql match special character % from a text
I have to select all rows from a table where column (varchar) values contain '%' in the text. 我必须从表(列(varchar)值在文本中包含“%”)中选择所有行。 I tried below query but failed to get correct result set.
我在下面的查询中尝试过,但未能获得正确的结果集。
SELECT * from TABLE where VALUE LIKE '%%%'
Above query gives all rows of the table. 上面的查询给出了表的所有行。
Please help me to form a query to match '%' and get the correct results. 请帮助我进行查询以匹配“%”并获得正确的结果。
SELECT * FROM your_table
WHERE value LIKE '%\\%%'
Escape character worked for me. 逃脱角色为我工作。
SELECT * from TABLE where VALUE LIKE '%\%%'
This query gives me correct result set. 此查询给我正确的结果集。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.