我想使用 LIKE
选项查找 varchar 是否包含 '
。
我觉得是这样的
select *
from table
where field like '%'%'
但有点不同。
最佳答案
关于转义单引号的回答:
您可以使用美元符号引号:
select * from table where field like $thing$%'%$thing$;
或在引号前使用 E:
select * from table where field like e'%\'%'
或者两个单引号:
select * from table where field like '%''%'
https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html
关于postgresql - 在文本 Postgres 中找到 "'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44198805/