[英]MySql: SELECT where a field value contains ' and "?
I want to retrieve a record where the value contains single quote and double quote. 我想检索一条记录,其中值包含单引号和双引号。
Tried The following: 尝试了以下内容:
select * from Table1 where id = '' . ~";:><?/\\!@#$%^*()_+|/ \\
select * from Table1 where id = '' . ~";:><?/\\!@#$%^*()_+|/ \\
?' select * from Table1 where id = '' . ~";:><?/\\!@#$%^*()_+|/ \\
?' ; ` ;`
Use LIKE
in WHERE
clause to check whether it contains single quotes( '
) and double quotes( "
). 在
WHERE
子句中使用LIKE
来检查它是否包含单引号( '
)和双引号( "
)。
Query 询问
select * from `your_table_name`
where `id` like '%''%'
or `id` like '%"%';
select * from table1 where name like "%'%" OR name like '%"%';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.